I have a navigation bar, and I need the active page, marked by “subactive” class on the li element to have white text instead of black. The HTML and CSS can be found here: http://jsfiddle.net/a4hBz/
I use color on the .subactive selector in CSS, but its ignored by the browser.
That’s largely due to how CSS “weighs” the styles. IDs always have more presidence over a standard tag name, class name or pseudo-class. A simple solution is to be as-specific with your anchor class applying the “Active” styling as you are with the rest of the standard elements. Basically:
Should become
If that doesn’t work for your schema, you’ll need to either turn
#sidenavin to a class, or work-around it some other way.By the way, what I was referring to earlier is a style’s specificity. As it currently stands, your styles weigh in like so:
Almost think of it like this:
The style with the highest number wins.