【发布时间】:2015-09-27 00:30:21
【问题描述】:
这个问题听起来很愚蠢,但是关于我的问题的做法是什么。我应该总是这样做吗:
<div>
Text goes here. Lots of text.
</div>
或者我是否应该始终将文本包装在 <p> 标记中?
<div>
<p>Text goes here. Lots of text.</p>
</div>
请指教。
【问题讨论】:
这个问题听起来很愚蠢,但是关于我的问题的做法是什么。我应该总是这样做吗:
<div>
Text goes here. Lots of text.
</div>
或者我是否应该始终将文本包装在 <p> 标记中?
<div>
<p>Text goes here. Lots of text.</p>
</div>
请指教。
【问题讨论】:
是的,你可以直接放在div里。你应该做任何你想要做的事情在层次上是正确的和语义上合适的。这可能意味着您需要一个 p 标签,也可能不需要。
【讨论】: