[thelist] pseudo-class selectors (css problem)

Scott Schrantz scotts at rci-nv.com
Wed Jul 11 13:25:25 CDT 2001


> From: Stan Haskins
> 
> in the html document, I've got a set of links nested inside <div
> class="nav"> tags. 
> The "nav" class obviously has a different set of properties 
> which all work
> fine, except for the links. Here's what I have in my style sheet:
> *************************
> a:link {color:#ff0;}
> 
> a.nav:link {color:#0f0;}
> ********************************
> 
> What am I missing?

> From: Bill Mason
> DIV.nav A:link {etc}

Like Bill said, you have to specify the class of the container before you
specify the tag, with a space in between. But, you can also make your CSS
more general by leaving off the DIV part from his code, and use:

.nav a:link {color: #0f0;}

This will set the link color for all <a> tags within *any* container with a
class of "nav", whether it be <div>, <table>, <p> or whatever.




More information about the thelist mailing list