Welcome to Episode 17 of the Learn HTML series! In this episode, we explore the difference between semantic and non-semantic HTML tags — a crucial concept in modern web development.
By the end of this episode, you’ll be able to:
- Understand what semantic HTML means
- Identify common semantic and non-semantic tags
- Know the benefits of using semantic tags for accessibility and SEO
Semantic tags clearly describe their meaning to both the browser and the developer.
<header>: Represents introductory content or a group of navigational links.<nav>: Represents a navigation section.<main>: Represents the main content of the document.<section>: Represents a standalone section.<article>: Represents self-contained content like blog posts or articles.<footer>: Represents footer content.
Non-semantic tags don’t provide any meaning about their content.
<div>: Generic container for content.<span>: Generic inline container.
- Accessibility: Screen readers and assistive tech understand your content better.
- SEO: Search engines can better crawl and index your site.
- Readability: Makes code more understandable for humans.
<!-- Semantic HTML Example -->
<article>
<header>
<h1>Blog Title</h1>
<p>By Varun</p>
</header>
<section>
<p>This is a blog about HTML tags...</p>
</section>
<footer>
<p>Published on April 2025</p>
</footer>
</article>➡️ Episode 18: Block-level vs Inline Elements
In the next episode, we’ll understand the difference between block-level and inline elements and how they impact layout and styling!