Different color for hyperlink text in special menu division
Posted: Sun, 2004-10-17 19:32
I have specified a color for a, a:hover, a:visited for most parts of my site. However, there are menu bars for which I would like to make the links a different color. How would I specify that?
I have tried creating a div but have not been able to figure out what commands to use within a div tag to change the "a" color.
Thanks.


Moderator
Posts: 2996
Joined: 2003-03-12
Location: Brisbane
Different color for hyperlink text in special menu division
Posted: Sun, 2004-10-17 23:01
Hi wchung,
If the other links aren't within a div you can use
div a {color:red;} div a:visited{color:green;} div a:hover{color:blue;}or whatever color you like.If all your links are within div's then you need to find a way to separate the ones you want to be different, class or id could help here.
There are other things that could be causing problems with links such as specificity, and the order of the pseudo classes( Link, Visited, Hover, Active).
Specificity is used to decide which style should be applied when more then one target an element. The more specific the style is the more likely the style will be applied.
Hope that helps
Your question may have already been answered, search and read before you ask.
newbie
Posts: 2
Joined: 2004-10-17
Different color for hyperlink text in special menu division
Posted: Mon, 2004-10-18 03:15
Tony,
Thanks. I've seen other explanations on how to do it but couldn't figure it out until reading yours. The whole idea of creating a separate style notation apart from the main div#menu didn't sink in until now.
Works great!
Thanks a bunch for digging me out of a real pit.