Should ol/ul be inside

or outside?

后端 未结 5 2228
南笙
南笙 2020-11-22 11:26

Which is standard compliant between these two?

Text text text ...

  1. First element
5条回答
  •  天命终不由人
    2020-11-22 11:58

    The second. The first is invalid.

    • A paragraph cannot contain a list.
    • A list cannot contain a paragraph unless that paragraph is contained entirely within a single list item.

    A browser will handle it like so:

    tetxtextextete

    1. first element

    other textetxet

提交回复
热议问题