如何防止具有DIV内容的段落元素自动关闭?

时间:2018-11-26 16:17:43

标签: html

我在段落元素中放置了一个DIV,并注意到DIV总是从新行开始,而不管DIV的样式设置为display:inline;。然后我读到: Paragraphs are block-level elements, and notably will automatically close if another block-level element is parsed before the closing p tag

可以采取任何措施来防止这种行为吗?

<!DOCTYPE html>
<html>
<body>

  <p>
    <label>ITCL</label>
    <div style="display:inline;">
      OR
    </div>
  </p>

  <div>
    <label>ITSC</label>
    <div style="display:inline;">
      MM
    </div>
  </div>

</body>
</html>

0 个答案:

没有答案