HTML Tutorial



HTML section tag


HTML <section> Tag

The <section> tag defines a standalone section of content that is related and grouped together under a common theme. It is a semantic HTML5 element and is often used to break a page into meaningful parts.


Purpose of <section>

Use <section> to divide your page into blocks like "About Us", "Services", or "Testimonials", each with its own heading. This improves structure, accessibility, and SEO.


Syntax

<section>
  <h2>Our Services</h2>
  <p>We offer web development, app development, and digital marketing.</p>
</section>
  

Example

<!DOCTYPE html>
<html>
  <head>
    <title>Section Example</title>
  </head>
  <body>

    <header>
      <h1>My Website</h1>
    </header>

    <section>
      <h2>About Us</h2>
      <p>We are a tech company focused on modern web solutions.</p>
    </section>

    <section>
      <h2>Our Team</h2>
      <p>Our team consists of experienced developers and designers.</p>
    </section>

  </body>
</html>
  

Best Practices

  • Always include a heading inside each <section>
  • Use it to group content that shares a common theme or purpose
  • Do not use <section> as a generic container; use <div> for that

Conclusion

The <section> tag helps organize your content into meaningful sections, making your HTML more semantic and easy to navigate.


🌟 Enjoyed Learning with Us?

Help others discover Technorank Learning by sharing your honest experience.
Your support inspires us to keep building!

Leave a Google Review