HTML and CSS Reference
In-Depth Information
Web, a local fi le, an e-mail address, or a network server. For example, to create a hyper-
text link to the tips.htm fi le, you could enter the following code:
<a href=”tips.htm”>Photography Tips</a>
This code marks the text Photography Tips as a hypertext link. If a user clicks the text, the
browser will load the linked resource (tips.htm). Note that fi lenames are case sensitive on
some operating systems, such as the UNIX operating system. Web servers running on those
systems differentiate between fi les named tips.htm and Tips.htm. For this reason, you might
fi nd that links you create on your computer do not work when you transfer your fi les to a
Web server. To avoid this problem, the current standard is to always use lowercase fi le-
names for all Web site fi les and to avoid using special characters and blank spaces.
Most browsers underline hypertext links unless a different style is specifi ed in a user-
defi ned style sheet. The font color of a link also changes based on whether or not the
user has also visited the linked resource. By default, most browsers display hypertext
links as follows:
Keep your filenames
short and descriptive so
that users are less apt to
make a typing error when
accessing your Web site.
• An unvisited link is underlined and blue.
• A previously visited link is underlined and purple.
• A link currently being clicked or activated is underlined and red.
However, Web page authors can use CSS to override these default settings.
Marking a Hypertext Link
• To mark content as a hypertext link, use
<a href=” reference ”> content </a>
where reference is the location being linked to and content is the document con-
tent that is being marked as a link.
You'll mark the names of the three sample pages in the navigation list you just created
as hypertext links.
To create a hypertext link to a document:
1. Return to the home.htm file in your text editor and go to the navigation list at the
top of the page.
2. Mark the text Home as a hypertext link using a set of <a> tags as follows:
<a href=”home.htm”> Home </a>
3. Mark the text Tips as a hypertext link using the following code:
<a href=”tips.htm”> Tips </a>
4. Mark the text Glossary as a hypertext link as follows:
<a href=”glossary.htm”> Glossary </a>
Figure 2-11 highlights the revised text in the home.htm file.
Search WWH ::




Custom Search