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.

    G

    # 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.

*May or may not contain any actual "CSS" or "Tricks".