Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App
geeksforgeeks
Browser
Continue

Related Articles

How to define a section in a document in HTML5 ?

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

In this article we will discuss how to define section in document in html5.we can create section in document using Section tag.

HTML <section> Tag: Section tag divide content into section and subsection. The section tag is used when there is requirement of two header, footer and other section of document.

Syntax:

<section> content </section>

Below is the code that illustrates the use of the section tag.

Example 1:

HTML




<!DOCTYPE html>
<html>
<body>
  <section>
    <h1>GFG Section-1</h1>
  </section>
 
  <section>
    <h1>GFG Section-2</h1>
     
<p> HTML5 HTML5</p>
 
  </section>
  <section>
    <h1>GFG Section-3</h1>
  </section>
 
  <section>
    <h1>GFG Section-4</h1>
     
<p>HTML5 HTML5</p>
 
  </section>
</body>
 
</html>

Output:

Example 2:

HTML




<!DOCTYPE html>
<html>
<body>
  <h2>GeeksforGeeks</h2>
  <section>
    <h2>Geek 1</h2>
     
<p>
      It is a Computer Science portal
    </p>
 
 
  </section>
 
  <section>
    <h2>Geek 2</h2>
     
<p>
      It is a Computer Science portal.
    </p>
 
 
  </section>
</body>
 
</html>

Output:


My Personal Notes arrow_drop_up
Last Updated : 19 Oct, 2021
Like Article
Save Article
Similar Reads
Related Tutorials