Semantic HTML: Better SEO and Accessibility
Semantic means "with meaning". Semantic tags tell Google and screen readers what each part of your page is.
Why it matters
<div> says nothing about its content. <nav> says "this is the menu". This helps:
- Search engines understand your page better.
- Blind users can jump straight to the menu or main content with their screen reader.
- You, because the code is easier to read.
More useful meaningful tags
<figure>
<img src="chart.png" alt="Sales went up 20% in March">
<figcaption>Monthly sales in 2026</figcaption>
</figure>
<time datetime="2026-12-03">3 December 2026</time>
<blockquote>A short quote from someone.</blockquote>
<button type="button">Open menu</button>Accessibility in 6 steps
Accessibility means everyone can use your site, including people who are blind, cannot use a mouse, or have poor eyesight. It also helps SEO, because Google reads pages in a similar way. These six steps cover most of it:
- Alt text on every meaningful image.
- Labels on every form field (see the Forms chapter).
- Headings in order: one h1, then h2, then h3.
- Strong contrast: dark text on light, or light on dark. Light grey on white is hard to read.
- Keyboard works: press Tab through your page. You should always see where you are.
- Clear link text: "Download the price list", not "click here".
A "skip to content" link
Keyboard users must press Tab through every menu link on every page before reaching the content. A skip link lets them jump straight there. It stays hidden until it gets keyboard focus.
<body>
<a class="skip" href="#main">Skip to content</a>
<header>...</header>
<main id="main">...</main>
</body>.skip { position: absolute; left: -999px; }
.skip:focus { left: 10px; top: 10px; }This website has one. Press Tab once at the top of any page to see it.
Mini project: from divs to meaning
Here is a page built only with divs. Rewrite it with semantic tags.
<div class="top">
<div class="logo">Spice Kitchen</div>
<div class="menu"><a href="#">Menu</a> <a href="#">Order</a></div>
</div>
<div class="content">
<div class="post">
<div class="title">Our new mango lassi</div>
<div>Made with fresh Alphonso mangoes.</div>
</div>
</div>
<div class="bottom">Call us: 98000 00000</div>One possible answer:
<header>
<a href="/" class="logo">Spice Kitchen</a>
<nav><a href="#">Menu</a> <a href="#">Order</a></nav>
</header>
<main>
<article>
<h1>Our new mango lassi</h1>
<p>Made with fresh Alphonso mangoes.</p>
</article>
</main>
<footer>
<address>Call us: <a href="tel:+919800000000">98000 00000</a></address>
</footer>It looks the same in the browser, but now Google knows the title, the article and the contact details, and a phone user can tap the number to call.
How to test your page
- Keyboard test: unplug the mouse and use only Tab, Enter and the arrow keys.
- Lighthouse: in Chrome DevTools, open the Lighthouse tab and run a report. It scores accessibility and SEO and lists what to fix.
- Screen reader: Windows has Narrator and Mac has VoiceOver built in. Listen to your page for one minute. You will quickly hear what is missing.
Practice time
- Rebuild your home page using header, nav, main and footer.
- Put your blog post inside
<article>with sections. - Wrap an image and its caption in
<figure>. - Run a Lighthouse report on your page and fix the first two problems.
- Add a skip link to your site and test it with the Tab key.
Quick summary
- Semantic tags describe what content is.
- They help SEO, accessibility and readable code.
- Use
ato go somewhere,buttonto do something.