The child element selector does not work

  }
    .nav>li{
        list-style: none;
        float: left;
        width: 120px;
        line-height: 40px;
        background-color: green;
        margin-left: 10px;
        text-align: center;
    }
</style>

< / head >
< body >
< ul class= "nav" >

<li>
    <ul class="sub">
        <li></li>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
    </ul>

</li>
Css
Apr.17,2022

first of all, you need to understand what a sub-selector is, which selects direct child elements.
so the .nav > li written in your style refers to the direct child element li in .nav , and does not include the li element

in sub .

Update: emmmmmm, I don't understand what you are trying to say.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e9bb19-4ed47.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e9bb19-4ed47.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?