According to the HTML 4 specs, the XHTML 2 specs and the HTML 5 specs that code is invalid.
HTML 4
<!ELEMENT
UL
– – (LI
)+
This means that inside a <ul>
there can only be multiple <li>
elements.
XHTML
Both types of lists (
ul|ol
) are made up of sequences of list items defined by theli
element.
HTML 5
Content model:
Zero or moreli
and script-supporting elements.
Note that script-supporting elements are elements that are not rendered, and currently include only <script>
and <template>
.