HTML section - how to use <section> tag

The HTML <section> tag is used to define a section in a document like articles, headers, footers.

Attributes

The section tag supports the global and event attributes.

Examples:

<article class="film_review"> <header> <h2>Australia</h2> </header> <section class="main_review"> <p>Great island!</p> </section> <section class="user_reviews"> <article class="user_review"> <p>Cities are great.</p> <footer> <p> Posted on <time datetime="2015-04-10 19:00">Apr 10</time> by Staff. </p> </footer> </article> <article class="user_review"> <p>Kangaroos are great.</p> <footer> <p> Posted on <time datetime="2015-04-11 19:00">Apr 11</time> by Staff. </p> </footer> </article> </section> <footer> <p> Posted on <time datetime="2015-04-11 19:00">Apr 11</time> by Staff. </p> </footer> </article>

Related HTML tags:

  • <article> - used to define an article of content
  • <header> - used to define a header section of the page
  • <footer> - used to define a footer section of the page