I have a class = "white_text" I want links of that class to be different to the rest of the page. I have used this css, but it doesn't work: a.white_text:link { color: white; } a.white_text:visited { color: white; } a.white_text:hover { color: #FF0000; } a.white_text:active { color: #990000; } Could someone correct this for me please. thanks
.white_text a:link { color: white; } .white_text a:visited {…} .white_text a:focus {…} .white_text a:hover {…} .white_text a:active {…} Code (markup): cheers, gary
^ isn't that if the links are in a parent with the class of white_text? I thought s/he meant that the links themselves had the class. a.white_text { color: #f00; } If I understood correctly, and it's the links themselves with that class, then the above will make any link at all with that class have a white colour. Then, you only wanted the active version of white_text to have a different colour? a.white_text :active { color: #900; } But I'm la famosa for misunderstanding things... if the links are in a box with the class of white-text then Gary's code above is the way to do it. Just remember that if you want everyone to act the same, it's less code to set those properties on a itself (not a:link, which cannot pass anything down to the other : properties) and then only list the ones that are different.