What is the difference between section and div ?
What is the difference between <section> and <div>?
<section>
means that the content inside is grouped
(i.e. relates to a single theme), and should appear as an entry in an
outline of the page.<div>
, on the other hand, does not convey any meaning, aside from any found in its class
, lang
and title
attributes.From the spec:
<section>
The(http://dev.w3.org/html5/spec-author-view/the-section-element.html#the-section-element)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: Thesection
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 thediv
element instead. A general rule is that thesection
element is appropriate only if the element's contents would be listed explicitly in the document's outline.
<div>
The div element has no special meaning at all. It represents its children. It can be used with the(http://dev.w3.org/html5/spec-author-view/the-div-element.html#the-div-element)class
,lang
, andtitle
attributes to mark up semantics common to a group of consecutive elements.
Note: Authors are strongly encouraged to view thediv
element as an element of last resort, for when no other element is suitable. Use of thediv
element instead of more appropriate elements leads to poor accessibility for readers and poor maintainability for authors.
What is the difference between section and div ?
Reviewed by (C#) Csharp examples
on
7:15 PM
Rating:
No comments: