HTML and CSS Reference
Plan how and where to use the four types of links.
Identify how to link from the home page to another page in the same Web site
Linking to another Web page in the same Web site is often done with text links. When
determining what words to use, make sure that the text links are clear and easy to
understand. Using a phrase such as “click here” is not one that clearly identifies where
the link will go. Choosing words such as “sample photographs” tells the Web site
visitor to click that link if they want to see sample photographs.
Use an e-mail link on the home page
• . A good standard practice is to include an e-mail
link on the home page. Again, using words such as “click here” are not as effective
as using a company's actual e-mail address (email@example.com in this
case) as the e-mail link text.
Determine external links for the home page
• . Visitors to a Web site might want additional
information on a topic, so a link can also be included on the home page (or any other
Web page in the Web site). Linking to an external Web site (i.e., one that is outside of
the boundaries of the current Web site) is appropriate to provide additional information.
Again, it is important to select words or phrases that make sense for that link.
Use internal links on long Web pages
• . Another good standard practice is to include
links within a Web page when the page is long (i.e., when you have to use the scroll
bar or press the p a g e d o w n key several times to get to the end of the Web page).
Internal links help visitors navigate more easily within long Web pages. Also consider
using links to help the visitor easily return back to the top of a long Web page.
Adding a Text Link to Another Web Page
Within the Same Web Site
For the purpose of this Web site, the <a> and </a> tags are used to create links on
a Web page. As mentioned earlier, the <a> (anchor) tag is used to create anchors for the
links. The anchor tag can also be used to specify the base language of the target URL or
to specify the media type of the link. The href attribute stands for a hyperlink reference.
This is a reference (an address) to a resource on the Web. Hyperlinks can point to any
resource on the Web, including an HTML page, an image, a sound file, or a video. The
basic form of the tag used to create a link is:
You also can create links
to other locations on the
Internet (that is, non-http)
such as FTP sites, and
newsgroups. To link to
an FTP site, type ftp://
URL rather than http://
URL as used in this
project. For a newsgroup,
name, and for any
particular article within
the newsgroup, type
news:article name as
where linktext is the clickable word or phrase that is displayed on the Web page and
the value for href (hypertext reference) is the name or URL of the linked page or file.
Table 3-4 shows some of the <a> tag attributes and their functions.
Table 3-4 <a> Tag Attributes and Functions
Specifies the URL of the linked page or file.
Defines a name (or id) for the current anchor so it may be the target or destination of another
link. Each anchor on a Web page must use a unique id.
Specifies the relationship between the current document and the linked document. The value
of the rel attribute is a link type, such as prev, next, author, or license. For example, the Web
page chapter3.html might include the tag <a rel=“next” href=“chapter4.html”> to indicate a
link to the Web page for the next chapter, chapter4.html.