When you use a space, it is a descendant/child selector, which means any
child that matches.  Therefore, "nav li" will target any li element that is
a child of nav (regardless of whether or not it is a child of a ul).
 Unless the nav element has several child ul's that need to be styled
differently, nav li will do just fine.  If you did have several ul's with
different styling, you might consider adding a class, and completely
eliminating the need to specify nav; it would be .myclass li.

Here is a write up on selectors from CSS Tricks:
http://css-tricks.com/child-and-sibling-selectors/
And here is an overview from webplatform.org:
http://docs.webplatform.org/wiki/css/selectors

Hope that helps!

Chris


On Thu, Sep 19, 2013 at 9:06 PM, John <j...@coffeeonmars.com> wrote:

>
> On Aug 30, 2013, at 6:53 PM, Philippe Wittenbergh <e...@l-c-n.com> wrote:
>
> > Without seeing your html structure and the rest of your stylesheet:
> >
> > nav ul li { display: inline-block; vertical-align: top; width 50%; /*
> rest of styles */ }
> >
> > PS - you could simplify that selector to: nav li {}
> >
> > Philippe
>
>
> Philippe: why can nav ul li be simplified to nav li?
>
> Thank you,
>
> John
> ______________________________________________________________________
> 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/
>



-- 
Chris Rockwell
______________________________________________________________________
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