agyanadda@gmail.com

HTML Semantic Elements

HTML Layout & Structure 1 min read Updated Nov 30, 2026 Topic 18 of 33

Semantic elements describe their meaning, not just their look. They help search engines, screen readers and other developers understand your page.

Element Use it for
<header> Top of the page or a section: logo, title
<nav> Main navigation links
<main> The main content (only one per page)
<section> A group of related content with a heading
<article> Independent content: blog post, news item
<aside> Side content: sidebar, related links
<footer> Bottom: copyright, contact links

Using <nav> instead of <div class="nav"> gives the same look but adds meaning — good for SEO and accessibility.

Example

Example — A semantic page layout HTML
<header>
  <h1>My Blog</h1>
  <nav>
    <a href="#">Home</a> | <a href="#">Posts</a> | <a href="#">Contact</a>
  </nav>
</header>

<main>
  <article>
    <h2>Learning HTML in 30 days</h2>
    <p>Here is how I learnt HTML step by step...</p>
  </article>
  <aside>
    <h3>Related posts</h3>
    <p>CSS basics</p>
  </aside>
</main>

<footer>
  <p>&copy; 2026 My Blog</p>
</footer>

Test Yourself With Exercises

Exercise 1 Multiple Choice

Which element is best for a blog post?

Exercise 2 True / False

A page should have only one <main> element.

Exercise 3 Fill in the Blank

Navigation links go inside the ___ element.

Frequently Asked Questions

No. They look like a normal div until you style them. Their benefit is meaning for SEO and accessibility.