On Fri, Jan 27, 2012 at 2:24 PM, Jukka K. Korpela <[email protected]> wrote: > 2012-01-27 7:55, Stuart King wrote: > >> http://skingdesign.com/todd/pages/pairings.html >> >> now the current page on #sidenav needs to be red. I have tried to do this >> - >> not successful. > > > Add > > #sidenav ul li a#current { color: red; } > > You have tried a simpler selector, just #current, but such a rule loses, in > the cascade, to > > #sidenav ul li a{ > /* stuff omitted here */ > color: #000000; > /* stuff omitted here */ > } > > Yucca
Yep. Yucca's right. The key phrase is "css specificity" and it can be a pain in the butt. Here's an article about it: http://www.htmldog.com/guides/cssadvanced/specificity/ I've run into this problem a lot less often since I learned about the Object-Oriented CSS concept: The GitHub Wiki: - https://github.com/stubbornella/oocss/wiki The presentation: - http://www.stubbornella.org/content/2009/03/23/object-oriented-css-video-on-ydn/ Or just the slides: - http://www.slideshare.net/stubbornella/object-oriented-css And a fairly recent article on the topic from SmashingMagazine: - http://coding.smashingmagazine.com/2011/12/12/an-introduction-to-object-oriented-css-oocss/ -- Vince Aggrippino a.k.a. Ghodmode http://www.ghodmode.com ______________________________________________________________________ css-discuss [[email protected]] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
