Nesting block level elements inside the

tag… right or wrong?

前端 未结 6 2100
遇见更好的自我
遇见更好的自我 2020-11-22 10:13

Is it syntactically and semantically correct to nest

or any other block level element inside the

tag. I am talking about HTML

6条回答
  •  隐瞒了意图╮
    2020-11-22 10:24

    No, a paragraph element may not contain other block elements.

    Reference

    A paragraph tag is intended for a block of text. If your elements is a part of the text (and not block elements), it would be semantically correct, otherwise not. A span tag with display:block is still a block element.

提交回复
热议问题