Get a free trial // Grow your CSS skills // Land your dream job

could you explaing the following CSS semantics?

  • # March 26, 2013 at 12:20 pm

    #leftnav ul.widgets li ul li {

    Could someone explain what “li ul li” means? What is the difference between the two “li” entries?

    Thank you.


    # March 26, 2013 at 12:26 pm

    @imhotep, it’s for specificity, it means:

    target `li` elements whose parent is a `ul` element, whose parent is an `li` element, whose parent is a `ul` with a class of `widgets` whose parent is an element with an ID of `leftnav`

    # March 26, 2013 at 12:26 pm

    Something like this:

      • This is what the CSS will target

    Basically, it’s targeting a 2nd tier of an unordered list (how you would make a dropdown nav, for example).

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed