Understanding Semantic HTML β€” Cleaner & Accessible Web Pages

krishankrishan
2 min read

This week I explored Semantic HTML as part of my frontend learning journey.

πŸ“Œ What is Semantic HTML?

Semantic HTML uses tags that convey meaning about the content inside them. Instead of generic <div>s and <span>s, you use:

  • <header> β€” intro/header content

  • <nav> β€” site navigation

  • <section> β€” grouped content sections

  • <article> β€” independent content like blog posts or product cards

  • <aside> β€” related or side content (like sidebars)

  • <footer> β€” footer content

  • <figure> & <figcaption> β€” for images, diagrams, or code blocks with captions

βœ… Why Use Semantic HTML?

  • Accessibility: Helps screen readers and assistive tech understand content structure

  • SEO: Search engines can better interpret your page

  • Maintainability: Cleaner, more meaningful code for developers

πŸ§ͺ Practice

I created a simple blog layout using only semantic tags. Here's a quick example using <article> to group independent content:

<article>
  <h2>Google Chrome</h2>
  <p>Google Chrome is a web browser developed by Google, released in 2008.</p>
</article>

You can also nest them, like this:

<article class="all-browsers">
  <h1>Most Popular Browsers</h1>
  <article class="browser">
    <h2>Mozilla Firefox</h2>
    <p>Open-source browser by Mozilla. Second most popular since 2018.</p>
  </article>
</article>

And here’s how I used <aside> for extra, relevant content:

<aside>
  <p>The Epcot Center is a theme park at Walt Disney World Resort...</p>
</aside>

πŸ“‚ GitHub: Semantic HTML Practice + Notes
(Feel free to clone the repo and follow along!)

Stay tuned as I continue sharing what I learn each week. πŸ™Œ

#frontenddevelopment #html #semantic #a11y #buildinpublic #webdev #krishanCode

0
Subscribe to my newsletter

Read articles from krishan directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

krishan
krishan

πŸ‘‹ Hey, I'm a Frontend Developer passionate about building clean, user-friendly interfaces. πŸš€ Learning and sharing everything from React, JavaScript, HTML/CSS to advanced topics like Data Structures, Algorithms & System Design. πŸ’» Documenting my journey from fundamentals to becoming a top-tier developer β€” one blog at a time. πŸ“š Join me as I break down complex topics into easy, practical lessons β€” with GitHub repos, code snippets, and real-world examples. πŸ” Consistent growth, community learning, and aiming high!