Structure
Use landmarks like <header>, <nav>, <main>,
<section>, <article>, <aside>, and <footer>
to create a navigable outline.
Semantic HTML gives meaning to content and creates a clear document outline for users, screen readers, and search engines. Accessibility (a11y) builds on semantics to ensure everyone can use your site regardless of ability, device, or context.
Use landmarks like <header>, <nav>, <main>,
<section>, <article>, <aside>, and <footer>
to create a navigable outline.
Screen readers rely on headings and landmarks. Strong semantics reduces the extra ARIA you need.
Search engines infer importance from headings, lists, and structure — semantics help them help you.
alt="".
<button> over a clickable <div>.<nav>).aria-label or aria-labelledby when there’s no visible label.Tables benefit from captions, scoped headers, and clear column meaning:
| Semantic | Use Case | Non-Semantic Equivalent |
|---|---|---|
<article> |
Self-contained piece of content | <div class="article"> |
<nav> |
Primary or secondary navigation | <div id="nav"> |
<main> |
Unique primary page content | <div id="main"> |
<h1> per page; descend logically with h2, h3, …alt (or empty alt for decorative images).