Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nesting a ul inside an ol

Im trying to make an ordered list with two items, and three items under each list, which have bullet points. my code is not passing validation because it saysElement ul not allowed as child of element ol in this context. But everywhere I look it says this is ok. here is my code

<ol>
    <li>First numbered Item</li>
        <ul>
            <li>one thing</li>
            <li>two things</li>
            <li>three things</li>
        </ul>
    <li>Second numbered Item</li>
        <ul>
            <li>one thing</li>
            <li>two things</li>
            <li>Three things</li>
        </ul>
</ol>

not sure what im doing wrong. thanks for the help, first post here :)

like image 724
rlavoir Avatar asked Mar 01 '26 23:03

rlavoir


1 Answers

The children of lists should be list items. You have both list items and unordered lists as children of your ordered list. You need something like:

<ol>
    <li>
        <p>First numbered Item</p>
        <ul>
            <li>one thing</li>
            <li>two things</li>
            <li>three things</li>
        </ul>
    </li>
    <li>
        <p>Second numbered Item</p>
        <ul>
            <li>one thing</li>
            <li>two things</li>
            <li>Three things</li>
        </ul>
    </li>
</ol>
like image 113
Mick Avatar answered Mar 03 '26 13:03

Mick



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!