我是网络编程新手, 我可以知道内联级别元素与短语元素之间有什么区别吗? em 和 Strong 它们是短语元素?但它们也是内联的吗,我不太明白其中的区别,
此外,如果您可以添加了解与内联、短语元素相关的 block 级元素的重要性,
谢谢
最佳答案
术语“短语元素”最后一次使用是在 HTML4.01 规范的9.2.1 短语元素部分中:
Phrase elements add structural information to text fragments. The usual meanings of phrase elements are following [followed by a list of phrase elements] (source).
它们呈现为内联级元素,它们不会形成新的内容 block 。在 HTML5 中,它们被重新定义为 phrasing elements .
对于 block 元素,请查看 CSS2.1 specification (section 9 Visual formatting model) :
Block-level elements are those elements of the source document that are formatted visually as blocks (e.g., paragraphs). The following values of the 'display' property make an element block-level: 'block', 'list-item', and 'table'.
因此,短语或短语更多的是语义属性,而内联级或 block 级是更多的是渲染属性。大多数短语元素是内联级元素,大多数流程元素是 block 级元素。
关于html - 行内元素 vs 短语元素 vs block 级元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11712206/