Affecting the Appearance of Links 135
Creating Links
Affecting the Appearance of Links
Web Design in a Nutshell, eMatter Edition
When linking down into a long page, it is generally a good idea to add links back
to the top of the page or to the table of contents.
Note that the HTML 4.0 Specification allows any element on a web page to be
targeted by its ID value just as though it were a named anchor. The first line
demonstrates a heading that includes an ID identifier. The second line is a link on
the same page to that particular heading.
<H2 ID="intro">Introduction</H2>
Return to the <A HREF="#intro">Introduction</A>
Affecting the Appearance of Links
As we all by now know, linked text is blue and underlined by default and
graphics are identified by blue borders (unless you turn them off). But it doesn’t
have to be that way! Changing the color of links is easy with HTML, so you can
make your links more coordinated with your chosen site palette. Style sheets offer
even more control over the appearance of links.
You should exercise some caution in changing link appearance. The blue text and
underlines have become a strong visual clue for “click here,” so altering this
formula may confuse your users. Use your knowledge of the savvy of your target
audience to guide your design decisions.
Setting Colors in
Link color specifications in the
tag are applied to the whole document.Specifying Color for a Specific Link
You can override the color of a specific link by placingtagswithinthe
anchor tags. There is no way to set the visited link and active link colors for
specific links. This feature is supported by versions 3.0 and 4.0 of Internet
Explorer, but only version 4.0 of Netscape Navigator.
<A HREF="document.html"><FONT COLOR=aqua>Specially colored
link</FONT></A>
Setting Global Link Colors with Style Sheets
You can apply almost any style sheet property to a link by using the anchor tag
() as a selector. However, CSS1 introduced a group of pseudo-classes (link,
Links <BODY LINK="color"> Sets the color for hyperlinks. The
default color for links is blue.
Visited links <BODY VLINK="color"> Sets the colors for links that have
already been clicked. The default
color for visited links is purple.
Active links <BODY ALINK="color"> Sets the color for a link while it is in
the process of being clicked. The
default color for an active link is
red.