HTML Full Course [Day 8] [Hindi] π» | Convert Basic HTML Code to a Semantic HTML5 π | Mohit Decodes
HTML Tutorial β Part 8: Convert Basic HTML to Semantic HTML5
Welcome to Day 8 of the HTML Full Course [Hindi] by Mohit Decodes! In this lesson, you will learn how to transform traditional HTML code into clean, meaningful, and modern Semantic HTML5.
π What is Semantic HTML5?
Semantic HTML5 uses tags that describe the purpose of content clearly, improving:
- Code readability and maintainability
- SEO (Search Engine Optimization)
- Accessibility for screen readers and assistive technologies
βοΈ Common Semantic HTML5 Tags & Their Uses:
TagPurpose | |
<header> | Page or section header |
<nav> | Navigation links |
<main> | Main content of the page |
<section> | Thematic grouping of content |
<article> | Independent content (e.g., blog posts) |
<aside> | Sidebar or related content |
<footer> | Footer of the page or section |
π Converting Basic HTML to Semantic HTML5:
Before (Basic HTML):
html
CopyEdit
<div id="header">
<h1>Welcome to Mohit Decodes</h1>
</div>
<div id="nav">
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
</ul>
</div>
<div id="content">
<p>This is a paragraph.</p>
</div>
<div id="footer">
<p>Β© 2025 Mohit Decodes</p>
</div>
After (Semantic HTML5):
html
CopyEdit
<header>
<h1>Welcome to Mohit Decodes</h1>
</header>
<nav>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
</ul>
</nav>
<main>
<p>This is a paragraph.</p>
</main>
<footer>
<p>Β© 2025 Mohit Decodes</p>
</footer>
π― Why Use Semantic HTML5?
- Improves SEO ranking
- Makes your code easier to understand for developers
- Enhances accessibility for users with disabilities
- Enables better browser support and future-proofing