Nest lists in paragraphs in html

后端 未结 5 2092
长情又很酷
长情又很酷 2020-12-11 15:57

It seems that (strict) html doesn\'t allow nesting any non-inline elements inside a

, but then how am I supposed to render a paragraph that contains a

5条回答
  •  长情又很酷
    2020-12-11 16:03

    The answer to your question is obviously no, because the specs say you can't do it. Like you, I like to maintain semantics, so I usually go with your 2nd option (paragraph, list, another paragraph). However, off the top of my head, I can't think of any text where the list doesn't actually break the flow of text, so it seems that starting a new paragraph after a list can't hurt.

提交回复
热议问题