Search code examples
htmlhtml-listssemantic-markup

Is it semantically correct in HTML to markup a list with only a single list item?


Is it semantically correct to markup a ul in HTML with another embedded ul that has only one single list item?

For example, I have a ul with several lis, and one of those lis has an embedded ul with a single li:

<ul>
  <li>Example LI 1
    <ul>
        <li>Example LI 1a</li>
    </ul>
  </li>
  <li>Example LI 2</li>
  <li>Example LI 3</li>
</ul>

Solution

  • Absolutely. A list is not defined by quantity. It's defined by semantics. So a list can consist of only one element if only one item applies to the list's purpose. For example, I have only crashed one computer today so that list would be only one element long.