Setting the Color of Hyperlinks


Until CSS, the most common use of color in Web browsers (other than in images) was to draw attention to hyperlinks. Some browsers use two colors: one for links that the user has traversed before and another for links that he hasn't tried yet. Others use a third color for an "active" link; that is, for the short duration while the user keeps the mouse button pressed over the text. In CSS, rules for these can be written through a pseudo-class on an A element, as follows:

 A:link { color: blue }      /* unvisited links */ A:visited { color: red }    /* visited links */ A:active { color: yellow }  /* active links */ 

For more information on pseudo-classes, see Chapter 4, "CSS selectors."



Cascading Style Sheets(c) Designing for the Web
Cascading Style Sheets: Designing for the Web (3rd Edition)
ISBN: 0321193121
EAN: 2147483647
Year: 2003
Pages: 215

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net