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