[thelist] pseudo-class selectors (css problem)

Joe Crawford jcrawford at avencom.com
Wed Jul 11 13:05:40 CDT 2001


Stan Haskins wrote:
> I'm having no luck assigning different properties to two different sets of
> links on a single page using an external style sheet.
> 
> 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:visited {color:#ccc;}
> a:hover {color:#000; font-style:italic;}
> a:active {color:#fff;}
> 
> a.nav:link {color:#0f0;}
> a.nav:visited {color:#000;}
> a.nav:hover {color:#000; font-style:italic;}
> a.nav:active {color:#000;}
> ********************************
> 
> What am I missing?

For these to be properly applied, they need to be in the links
themselves:

<a href=".." class="nav">hello</a>.

Whatever nav" styles are applied to the div are OVERRIDDEN by the styles
you have for the "a" tag.

So put the class into the anchors and you should be golden.

	- Joe <http://artlung.com/>
p.s.: Thanks to Jeff, and Scott, and all the folks who have helped me in
the past few days. Catching up on email. WarFTP in particular rocked my
world.
-- 
...................  Joe Crawford \\ Web Design & Development
.....  mailto:jcrawford at avencom.com \\ http://www.avencom.com
.... San Diego \\ CA \\ USA \\ AVENCOM: Set Your Sites Higher




More information about the thelist mailing list