# Semantic HTML Elements

> Why a nav, a main and a button beat a pile of div tags. How the right tag helps screen readers, keyboards and search engines.

**Course:** [HTML, CSS and JavaScript](https://learn.benibix.com/learn/development-web)  
**Time:** 10 min

**After this lesson you can:**

- Pick a semantic tag for each part of a page
- Explain what a screen reader gets from it
- Say why a button beats a clickable div

## Why the right tag matters more than the look

Semantic HTML means picking the tag that says what each part of a page is. A menu goes in <nav>, the main content in <main>, and a button in <button>. A <div> says nothing at all. A page can look the same both ways, but only one of them can be understood by a machine.

The main parts of a page each have a tag. The <header> holds the logo and the top links. The <nav> holds the menu. The <main> holds what the page is about, and there should be one. An <article> is a piece that stands alone, such as a post. The <footer> sits at the bottom.

A screen reader is the first to gain. It is an app that reads the page out loud for people who cannot see it. It lists the headings and the main parts, so a user can jump straight to <main> or to the third heading. With only <div> tags, there is nothing to jump to.

The right tag also brings free behaviour. A <button> can be reached with the Tab key and pressed with Enter or Space. A <div> made clickable with JavaScript can do neither until you add all of it by hand. Most people who build it that way never do.

Headings work the same way. Use one <h1> for the page title, then <h2> for each section and <h3> inside those. Do not skip from <h1> to <h4> because the smaller size looks nice. The levels are an outline, and screen readers and search engines read them as one.

There is a set of labels called ARIA that can tell a screen reader what a <div> is meant to be. It is a patch, not a first choice. The first rule of ARIA is to use a real HTML tag when one exists. That tag already has the meaning and the keyboard support.

All of this is a big part of accessibility: making a thing that everyone can use. It is not extra work for a few users. A page with clear tags is easier to search, easier to style and easier for the next coder to read.

![The same page layout drawn twice. On the left, every part is a plain div box. On the right, the same parts are named header and nav at the top, main and article in the middle, aside at the side, and footer at the bottom.](https://learn.benibix.com/diagrams/dev-semantic-html.svg)

### Example: Lucy fixes a menu nobody could reach

Lucy's shop menu was built from 8 <div> tags that opened on a click. Keyboard users pressed Tab 30 times and never reached it.

She swaps them for a <nav> holding real <button> and <a> tags. Now Tab reaches the menu in 2 presses, and a screen reader announces it as navigation.

**Words in this lesson:** [Semantic HTML](https://learn.benibix.com/term/development/semantic-html), [Screen Reader](https://learn.benibix.com/term/design/screen-reader), [ARIA Attributes](https://learn.benibix.com/term/design/aria), [Accessibility (a11y)](https://learn.benibix.com/term/design/accessibility)

**Question:** Why use a <button> tag instead of a clickable <div>?

**Answer:** A button works with the keyboard and screen readers for free. A real button can be reached with Tab and pressed with Enter or Space, and a screen reader calls it a button. A div needs all of that added by hand.

---

Source: https://learn.benibix.com/learn/development-web/semantic-html-elements
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
