Semantic Elements and Accessibility
What you'll learn: How using semantic HTML automatically improves your site's accessibility for screen reader users and assistive technologies.
When you use semantic elements like <nav>, <main>, or <article> instead of generic <div> tags, you're not just organizing your code — you're providing hidden "signposts" that assistive technologies can read and understand.
Built-In Accessibility Benefits
Screen readers (software that reads web pages aloud for visually impaired users) rely on the structure of HTML to help users navigate. When you use <nav>, screen readers automatically announce "navigation landmark." A <main> element tells them "this is the primary content." A <header> signals "banner."
These announcements are called implicit ARIA roles. ARIA (Accessible Rich Internet Applications) is a set of attributes that help assistive technologies understand page structure, but semantic HTML provides many of these roles automatically — no extra code needed.
Navigation Made Easy
Think of semantic HTML like a building with clearly labeled rooms: "Kitchen," "Bedroom," "Bathroom." Someone navigating in the dark can find what they need quickly. Generic <div> elements are like unmarked doors — you have to open each one to see what's inside.
Screen reader users can pull up a list of all landmarks (<nav>, <main>, <aside>, etc.) and jump directly to the section they need, just like sighted users scanning a page visually. Without semantic elements, they'd have to listen to everything sequentially.
The Accessibility Chain
Your semantic choices from previous lessons (<header>, <article>, <footer>, heading hierarchy) all work together to create an accessible experience. A properly structured document helps everyone — not just screen reader users, but also users with cognitive disabilities, keyboard-only navigation, and search engines.
Key Takeaway: Semantic HTML isn't just about clean code — it automatically provides accessibility features through implicit ARIA roles, making your site navigable and understandable for assistive technologies without extra work.