22
I was reading here about the element <section>
. I read the specification, I read some articles about, and I still can’t understand what benefit this element brings that is no longer covered by the element <div>
.
I saw the example in the specification itself and found it somewhat contradictory. The W3C shows an example in which the summary of a book is divided into sections, and the sections are formatted with CSS. But early on in the specification there is a recommendation that it should not be done:
The element
section
is not a generic container element. When an element is needed only for styling purposes or for scripting convenience authors are encouraged to use the elementdiv
.
So, after all, when and why to use <section>
instead of <div>
?
I like the explanation given by html5doctor in this Flowchart.
– Beterraba
Great article, this current to the present day.
– Victor Ariexiet