HTML5 Section Tags

Hi, I am bit confused on the proper way to use <section> tags
in the HTML, even after reading about them. Should they be used
inside a <div> tag? replace the <div> tag? or what is a good practice
to use them?

<div>
  <section></section>
</div>

Most times, div can be replaced by something else and divs are used when you want to apply a specific style.

I found this great infographic which might help: http://html5doctor.com/downloads/h5d-sectioning-flowchart.png

2 Likes

There is no need to put them in a div.
They can replace a div, but only when it is semantically correct. They are not an all-purpose generic container like div, they have a specific meaning.
http://www.w3.org/TR/html5/sections.html#the-section-element

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.