Using a <li>
or <dt>
item tag outside of a <ul>
, <ol>
or
<dl>
one does not make sense and indicates a bug.
Noncompliant code example
<li>Apple</li> <!-- Noncompliant -->
<li>Strawberry</li> <!-- Noncompliant -->
<li>Apple</li> <!-- Noncompliant -->
<li>Strawberry</li> <!-- Noncompliant -->
<dt>Apple</dt> <!-- Noncompliant -->
<dt>Strawberry</dt> <!-- Noncompliant -->
Compliant solution
<ul>
<li>Apple</li>
<li>Strawberry</li>
</ul>
<ol>
<li>Apple</li>
<li>Strawberry</li>
</ol>
<dl>
<dt>Apple</dt>
<dt>Strawberry</dt>
</dl>