faqts : Computers : Programming : Languages : JavaScript : Links

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

7 of 11 people (64%) answered Yes
Recently 6 of 10 people (60%) answered Yes

Entry

How do i change the color of one of the text links on my page to differ from the other text links?

Dec 13th, 2002 11:46
Klaus Bolwin, Joey Neary,


You should add a class- or id-attribute to the a-tag:
<a id="xy" href="...">...
or 
<a class="xyz" href="...">...
then you can controll the colors of a goup of links by CSS using classes:
e.g.
a.xyz:link{font-family: Arial;  font-size: 12pt; font-weight:normal;
color:#ffcc00; text-decoration:none;}
a.xyz:visited{font-family: Arial;  font-size: 12pt; font-weight:normal;
color:#ffcc00; text-decoration:none;}
a.xyz:hover{font-family: Arial; font-size: 12pt; font-style:normal;
color:#ff0000; text-decoration:none;}
or controlling the colors of a single link by using the id-attribute:
a#xy:link{font-family: Arial;  font-size: 12pt; font-weight:normal;
color:#ffcc00; text-decoration:none;}
and so on.