How to make multi color A tag by CSS?

liunx

Guest
Hi all,

I am using CSS to control my web page, but now I finded a problems on my using of the CSS, since I want to make two or third different A tag for the hyperlink's text color, but I don't know how to do it by the CSS code, can anyone some a example to me? thx

Here are the CSS code I defined for the A tag, and the color's value.

a {
text-decoration: none;
}
a:link {
color: #666666;
}
a:visited {
color: #666666;
}
a:active {
color: #666666;
}
a:hover {
color: #FF9900;
}


If I have a code like this on my xhtml web page, just for example

<a href=http://www.webdeveloper.com/forum/archive/index.php/"#">16</a> <<<----- It will be run the CSS color #666666

But, if I want to make other link on a text, but the color not is #666666, how to do it by CSS?? Need write what code of the CSS to do like that??

For example

<a href=http://www.webdeveloper.com/forum/archive/index.php/"#">18</a> <<-- this time I want to the color is "Green", but also keep other link color is #666666 for all other link, just this one is "green" color, how to make it by CSS code?CSS:

a {
text-decoration: none;
}
a:link, a:visited, a:active {
color: #666666;
}
a:hover {
color: #FF9900;
}
a.green:link, a.green:visited, a.green:active {
color: green;
}
a.green:hover {
color: lime;
}

HTML:

<a class=green href=http://www.webdeveloper.com/forum/archive/index.php/"somepage.html">This is a green link</a>you could make a new id for the other link color.. for an example lnk2 (Link 2)

a:link.lnk2, a:visited.lnk2, a:active.lnk2 { color:green}
<a href=http://www.webdeveloper.com/forum/archive/index.php/"#" class="lnk2">This is now a green link </a>

or

if your link is inside a unique Div which you don纾
 
Back
Top