关于HTML5:
有什么区别

What is the difference between <section> and <div>?

HTML中的

有什么区别?我们不是在这两种情况下都定义了部分吗?


表示内部内容被分组(即与单个主题相关),并应作为页面大纲中的条目出现。

另一方面,除了在其classlangtitle属性中发现的任何含义外,没有任何含义。

所以不是:使用并不能在HTML中定义节。

从规格:

The

element represents a generic section of a document or application. A section, in this context, is a thematic grouping of content. Each section should be identified, typically by including a heading (h1-h6 element) as a child of the

element.

Examples of sections would be chapters, the various tabbed pages in a tabbed dialog box, or the 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

element is not a generic container element. When an element is needed only for styling purposes or as a convenience for scripting, authors are encouraged to use the element instead. A general rule is that the

element is appropriate only if the element’s contents would be listed explicitly in the document’s outline.

(https://www.w3.org/tr/html/sections.html节元素)

The element has no special meaning at all. It represents its children. It can be used with the class, lang, and title attributes to mark up semantics common to a group of consecutive elements.

Note: Authors are strongly encouraged to view the element as an element of last resort, for when no other element is suitable. Use of more appropriate elements instead of the element leads to better accessibility for readers and easier maintainability for authors.

(https://www.w3.org/tr/html/grouping content.html the div元素)


标记一个节,标记一个没有关联语义的通用块。


Vs
第1轮

:html元素(或html document division元素)是流内容的通用容器,它本身并不表示任何内容。它可以用于将元素分组以进行样式设置(使用类或ID属性),或者因为它们共享属性值(如lang)。只有在没有其他语义元素(如