What is Semantic HTML?
You'll learn the difference between semantic and non-semantic HTML elements, and why choosing meaningful tags matters for accessibility and search engines.
The Core Idea
Semantic HTML means using tags that describe their content's meaning rather than just how it looks. Think of it like labeling boxes when you move: you could label everything "Box" (non-semantic), or you could write "Kitchen Dishes" and "Winter Clothes" (semantic). Both hold stuff, but the descriptive labels tell you what's inside without opening them.
In HTML, a <div> is like a generic box—it just groups content without saying what that content is. But elements like <header>, <nav>, <article>, and <footer> tell browsers, search engines, and assistive technologies exactly what role that content plays on your page.
Why Semantics Matter
For Accessibility: Screen readers used by visually impaired users rely on semantic tags to navigate. When you use <nav> for navigation links, the screen reader can announce "navigation region" and let users jump directly there. A <div> provides no such context.
For SEO: Search engines understand semantic HTML better. An <article> tag signals "this is the main content," helping Google understand what your page is about. A <h1> clearly marks your primary heading. Search engines can index semantic pages more accurately.
For Maintainability: When you or another developer reads your code later, <aside> immediately communicates "this content is tangentially related" better than <div class="sidebar"> ever could.
The Principle
Choose tags based on what the content is, not how you want it to look. Styling comes from CSS (remember the separation of concerns!). HTML describes structure and meaning.
Key Takeaway: Semantic HTML uses descriptive tags that convey meaning, making your pages more accessible to assistive technologies, more discoverable by search engines, and easier for humans to understand.