HTML 4规范将以下内容视为已弃用的示例(搜索"DEPRECATED EXAMPLE"):
<UL>
<LI> ... Level one, number one...
<OL>
<LI> ... Level two, number one...
<LI> ... Level two, number two...
<OL start="10">
<LI> ... Level three, number one...
</OL>
<LI> ... Level two, number three...
</OL>
<LI> ... Level one, number two...
</UL>
Run Code Online (Sandbox Code Playgroud)
为什么这个例子被弃用了?
规范详细说明了嵌套ul和ol元素的正确方法.它们必须包含在li元素中,如下所示:
<ul>
<li>
<ol>
<li>Hello there</li>
</ol>
</li>
</ul>
Run Code Online (Sandbox Code Playgroud)
但是在您的示例中,列表未包含在li标记中,这意味着它将无法通过HTML验证.