9 nov 2013 03.08 Karl DeSaulniers:

> body nav li#about-us {
> /*Apply styles for current page*/
> }  
> 
> Does the same thing. 

No, it doesn't. :-)
You need one varying page (or rather site section) identifier that is different 
on every page as in the as you will have several descendent selectors:

body#page-about-us li#about-us, body#page-company-stuff li#company-stuff {
/*Apply styles for current page*/
}

See?


> body nav#about-us-page li#about-us {
> /*Apply styles for current page*/
> }  

It doesn't matter where in the hierarchy you put the page identifier, but it 
will have to be different on different pages. So this will work. Of course, one 
reason to not put it in the nav is that you may want to include the same nav 
for every page. 

If you are indeed identifying the page or the site section, it's more natural 
to put it in the html or body element. Those elements are the page, unless you 
deem it differently.

Again, this is mostly relevant if you have a static web site. I still use this 
basic method in quick design prototypes. Not too often though. 

I guess this is a side note now.
______________________________________________________________________
css-discuss [css-d@lists.css-discuss.org]
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/

Reply via email to