Ok, so I have this code in a style sheet:

div#mainnav{
background-color: #006;
color: #ccf;
font: "Arial, Helvetica, sans-serif" 70% bold;
}

div#mainnav a:link, a:visited {
color: #ccf;
text-decoration: none;
font-size: 70%;
font-weight: bold;
}

div#mainnav a:hover {
color: #006;
background-color: #ccf;
}


div#footer{
clear: both;
background: #000;
color: #FFF;
border-top: 1px gray solid;
margin-top: 1em;
font-size: 65%;
}

div#footer a:link, a:visited, a:hover {
text-decoration: none;
font-variant: small-caps;
font-size: 100%;
}

Can anyone tell me why in my content code, an <a> tag in the mainnav div is picking up the rules for <a> tags in the footer div? I actually see this throughout. I thought that the whole idea behind contextual selectors was that their rules applied only to those elements that are decendant from the contextual selector. In other words, I thought that I could specify big purple text on a yellow background for mainnav <a>s and a completely different color scheme for footer <a>s and as long as I set up the style sheet correctly they would be rendered individually.

Now, I may be making a mistake in my css, I am relatively new to it. If so, what is the mistake?

I know that ALL of the <a> tags are getting all of the rules. What to do? Does the question even make sense? (It's late on Friday, and a stupid SQL query that I need to babysit has been running for 2 hours and hasn't finished and I want to go home....)

Arrrggghh.
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to