将ul嵌套在ol中 [英] Nesting a ul inside an ol

查看:67
本文介绍了将ul嵌套在ol中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个有序列表,其中包含两个项目,每个列表下有三个项目,每个项目都有项目符号要点.我的代码未通过验证,因为在这种情况下,它说Element ul不允许作为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 :)

推荐答案

列表的子代应为列表项.您同时拥有列表项和无序列表,作为有序列表的子级.您需要类似的东西:

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>

这篇关于将ul嵌套在ol中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆