We’re getting some suspicious HTML from our designer. Is the following valid? (note the UL inside the UL)
<ul>
<li>1</li>
<ul>
<li>1.1</li>
<li>1.2</li>
<li>1.3</li>
</ul>
<li>2</li>
<ul>
<li>1.1</li>
<li>1.2</li>
<li>1.3</li>
</ul>
</ul>
According to the HTML 4 specs, the XHTML 2 specs and the HTML 5 specs that code is invalid.
HTML 4
This means that inside a
<ul>there can only be multiple<li>elements.XHTML
HTML 5
Note that script-supporting elements are elements that are not rendered, and currently include only
<script>and<template>.