Why are inline div behaving this way inside p

前端 未结 1 1683
我在风中等你
我在风中等你 2021-01-22 10:24

In the linked example, I have a text and a paragraph which each contain span and div elements. Although all the div elements have the

1条回答
  •  南笙
    南笙 (楼主)
    2021-01-22 11:00

    div inside p is invalid markup. When the browser encounters the div element it auto-closes the p tag and starts the new div.

    0 讨论(0)
提交回复
热议问题