当需要更高级的东西时,我总是使用 <br/>
或 <div/>
标签.
I have always used either <br />
or a <div/>
tag when something more advanced is necessary.
是否仍鼓励使用 <p/>
标签?
Is use of the <p/>
tag still encouraged?
现代 HTML 语义有:
Modern HTML semantics are:
<p></p>
在文档中包含一段文本.<br/>
表示段落内的换行符(即没有段落块边距或填充的新行).<div></div>
包含一块恰好具有块布局的应用程序 UI.<p></p>
to contain a paragraph of text in a document.<br />
to indicate a line break inside a paragraph (i.e. a new line without the paragraph block margins or padding).<div></div>
to contain a piece of application UI that happens to have block layout.不要单独使用 <div/>
或 <p/>
,这些标签是用来包含内容的.它们似乎只是作为段落分隔符起作用,因为当浏览器看到它们时,它会有用地"关闭当前块标签,然后再打开空标签.
Don't use <div />
or <p />
on its own, those tags are meant to contain content. They appear to work as paragraph breaks only because when the browser sees them, it "helpfully" closes the current block tag before opening the empty one.
这篇关于我应该使用 <p/>标记中的标记?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!