What is the difference between <section>
and <div>
in HTML
?
Aren't we defining sections in both cases?
Html – the difference between and
html
Related Topic
- Html – the difference between HTML tags and
- Html – What’s the difference between and , and
- Html – Set cellpadding and cellspacing in CSS
- Html – How to align content of a div to the bottom
- Html – Difference between id and name attributes in HTML
- Html – How to make a div 100% height of the browser window
- HTML 5: Is it
,
, or
- Html – How to remove the space between inline/inline-block elements
html
Related Topic
- Html – the difference between HTML tags and
- Html – What’s the difference between and , and
- Html – Set cellpadding and cellspacing in CSS
- Html – How to align content of a div to the bottom
- Html – Difference between id and name attributes in HTML
- Html – How to make a div 100% height of the browser window
- HTML 5: Is it
,
, or- Html – How to remove the space between inline/inline-block elements
Best Answer
<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 itsclass
,lang
andtitle
attributes.So no: using a
<div>
does not define a section in HTML.From the spec:
<section>
(https://www.w3.org/TR/html/sections.html#the-section-element)
<div>
(https://www.w3.org/TR/html/grouping-content.html#the-div-element)