html5 – section和div之间有什么区别?

前端之家收集整理的这篇文章主要介绍了html5 – section和div之间有什么区别?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
之间的区别是什么?和
在HTML?我们不是在这两种情况下都定义节?
意味着内部的内容被分组(即,与单个主题相关),并且应当作为页面的轮廓中的条目出现。
另一方面,除了在其类,lang和title属性中找到的任何内容之外,不传达任何含义。

从规格:

The section element represents a generic section of a document or application. A section,in this context,is a thematic grouping of content,typically with a heading.

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.

Note: The section element is not a generic container element. When an element is needed for styling purposes or as a convenience for scripting,authors are encouraged to use the div element instead. A general rule is that the section element is appropriate only if the element’s contents would be listed explicitly in the document’s outline.

(http://dev.w3.org/html5/spec-author-view/the-section-element.html#the-section-element)

The div 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 div element as an element of last resort,for when no other element is suitable. Use of the div element instead of more appropriate elements leads to poor accessibility for readers and poor maintainability for authors.

(http://dev.w3.org/html5/spec-author-view/the-div-element.html#the-div-element)

http://stackoverflow.com/questions/6939864/what-is-the-difference-between-section-and-div

本站文章除注明转载外,均为本站原创或编译
转载请明显位置注明出处:html5 – section和div之间有什么区别?

解决方法

意味着内部的内容被分组(即,与单个主题相关),并且应当作为页面的轮廓中的条目出现。
另一方面,除了在其类,lang和title属性中找到的任何内容之外,不传达任何含义。

从规格:

The section element represents a generic section of a document or application. A section,typically with a heading.

Examples of sections would be chapters,and contact information.

Note: The section element is not a generic container element. When an element is needed for styling purposes or as a convenience for scripting,authors are encouraged to use the div element instead. A general rule is that the section element is appropriate only if the element’s contents would be listed explicitly in the document’s outline.

(http://dev.w3.org/html5/spec-author-view/the-section-element.html#the-section-element)

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

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

(http://dev.w3.org/html5/spec-author-view/the-div-element.html#the-div-element)

http://stackoverflow.com/questions/6939864/what-is-the-difference-between-section-and-div

本站文章除注明转载外,均为本站原创或编译
转载请明显位置注明出处:html5 – section和div之间有什么区别?

原文链接:https://www.f2er.com/html5/170703.html

猜你在找的HTML5相关文章