Jump to content

ul ul ul?


sepoto
 Share

Recommended Posts

That selector targets anchors which are in unordered lists, which are in unordered lists, which are in unordered lists, which are in the division with ID "menu". This may be used, for example, if you have a list of links or a dropdown menu three levels deep, and want to target only the links at the third level.

Link to comment
Share on other sites

This may be used, for example, if you have a list of links or a dropdown menu three levels deep, and want to target only the links at the third level.
... and deeper levels, if any (in the way this is written).
Link to comment
Share on other sites

How did you determine that it may style tags deeper than three levels?
A space is the "descendant" selector meaning it will target all elements contained in the parent regardless of how deeply they are nested.A > sign is the "child" selector which will only target direct descendants, meaning it will not go any deeper than the first nested level.
Link to comment
Share on other sites

Selectors separated by spaces only indicate that one is an ancestor of the next one. There is no limit to the number of elements that can be nested between them.ul ul targets ANY ul nested inside the first ul. In theory, the second ul could be nested 20, 30, an infinite number of levels deep, and any number of intermediate elements could also be ul elements.ul>li>ul is much more specific. It targets a ul that is the child of an li that is the child of a ul. No intermediate elements.EDIT. Sometimes it's like a race around here.

Edited by Deirdre's Dad
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...