html - <div> 和 <section> 之间的确切区别是什么?就像我知道 Section 有 'meaning' 而 div 没有,但这是什么意思?

标签 html css

<分区>

我的意思是,根据我的研究,我知道它的行为方式与 相同,除了 section 有意义而 div 没有。这到底是什么意思? 与使用 div 时相比,使用 section 在浏览器上的输出会有所不同吗? 我只是想想象一下差异。请不要给我任何谷歌搜索的答案,因为我已经用谷歌搜索了它,但仍然没有 100% 理解它。 仅仅是为了可读性吗? 谢谢

最佳答案

W3 wiki 上对部分有很好的解释:

The <section> element represents a generic section of a document or application.

  • A section, in this context, is a thematic grouping of content:
    • chapter
    • various tabbed pages in a tabbed dialog box
    • numbered sections of a thesis ...
  • A Web site's home page could be split into sections for an introduction, news items, and contact information.
  • The section element is not a generic container element. The section element is appropriate only if the contents would be listed explicitly in the document's outline. [Example A]
  • A section typically with a heading.

<div>标签将用作 general flow container .规范定义了允许的内容:

http://www.w3.org/TR/html-markup/terminology.html#flow-content

关于html - <div> 和 <section> 之间的确切区别是什么?就像我知道 Section 有 'meaning' 而 div 没有,但这是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25534076/

相关文章:

javascript - 无法检查是否有值(value)且可见

CSS 悬停通过 webkit 3d 变换多次触发

javascript - 溢出隐藏 - IE7 中的问题

javascript - 在不禁用滚动功能的情况下防止 iOS 弹跳

html - 字体大小取决于 div 宽度和高度

javascript - JQuery 'css .change 没有注册

JavaScript 表单验证框高亮显示

javascript - Image Fades Into Another,然后函数加载新网页

css - 什么是 css 子网格的替代品?

html - CSS 3 行,第一行固定大小,最后一行固定大小,居中休息