Proper way to make HTML nested list?

前端 未结 7 1424
执念已碎
执念已碎 2020-11-22 04:05

The W3 docs have a nested list example prefixed by DEPRECATED EXAMPLE:, but they never corrected it with a non-deprecated example, nor explained exactly what is

7条回答
  •  日久生厌
    2020-11-22 04:38

    Option 2 is correct.

    The nested list should be inside a

  • element of the list in which it is nested.

    Link to the W3C Wiki on Lists (taken from comment below): HTML Lists Wiki.

    Link to the HTML5 W3C ul spec: HTML5 ul. Note that a ul element may contain exactly zero or more li elements. The same applies to HTML5 ol. The description list (HTML5 dl) is similar, but allows both dt and dd elements.

    More Notes:

    • dl = definition list.
    • ol = ordered list (numbers).
    • ul = unordered list (bullets).

提交回复
热议问题