Are there nested HTML lists?
The HTML 4 spec treats the following as a deprecated example (search for "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>
Why is this example outdated?
+3
source to share
2 answers
The attribute was start
deprecated in HTML 4 (it was not deprecated in HTML 5 ). Everything else in this example is fine.
+6
source to share
The specification details how to nest elements ul
and ol
. They must be enclosed in an element li
like this:
<ul>
<li>
<ol>
<li>Hello there</li>
</ol>
</li>
</ul>
However, in your example, the lists are not wrapped with a tag li
, which means that this will cause HTML validation to fail.
+5
source to share