CSS ' nav ul li ul ' and ' Nav>ul>li ' are the differences between the two ways

Source: Internet
Author: User

> refers to a generation only, such as: Nav>ul>li>ul>li, must be the following

            <nav>                <ul>                    <li>                        <ul>                            <li></li> </ul> </li> </ul> </nav>

Then the Nav UL Li ul only requires that the following elements are in the order of the Nav label, which is insensitive to the interval of several layers , such as:

  <nav> <div> <ul> & lt;div> <a> <li> <div> <ul> <li> </li> </ul> </div> Span class= "hljs-section" ></li> </a> </div > </ul> </div>  </nav>                    





<Nav><UlId="A" ><Li></Li><Li></Li><Li></Li><Li></Li><Li><UlId="B" ><Li></Li><Li></li> </ul> </li> < li> <ul id=  "C" > <li> </li>< Li></li> </ ul> </li> </ul></ Nav>               

nav>ulSelect only the UL elements in the lower level of NAV, such as UL with ID A in the DOM structure above.
nav ulSelect all UL elements contained within NAV, such as all UL IDs A, B, and C in the DOM structure above.

nav>ulnav ulmore stringent than the qualification, the element must be behind only one level lower than the previous.

CSS ' nav ul li ul ' and ' Nav>ul>li ' are the differences between the two ways

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.