# What Semantic HTML Means

Semantic elements such as strong, nav, main and footer say what their content is, so the HTML describes the content and CSS handles how it looks.

Apprentice · HTML · Updated October 31, 2026

## After this lesson you can

- Replace the formatting tags b, i, u and center with strong, em or CSS
- Mark up a page's regions with header, nav, main, aside, article, section and footer instead of div

## Key takeaways

- A semantic element's name says what its content is, such as a navigation bar, the main content or an important phrase.
- Use strong and em for importance and emphasis, and do bold for looks, underlining and centering with CSS.
- Mark up a page's regions with header, nav, main, aside and footer instead of a div with an id.
- Semantic HTML helps screen readers and search engines, and it makes your HTML easier for the next person to read.

Sooner or later a class assignment, a code review or a job posting will ask for **semantic HTML**. An accessibility checker will say *the page has no main landmark*. Both are about the same idea, and it's the idea this whole module is built on: every element should say what its content *is*, not how it should look.

## Labeled moving boxes

Picture moving day. You can pack everything into plain brown boxes and number them 1 to 20. They all look the same, and they all hold your stuff. But when they arrive, nobody knows which box goes in the kitchen, so someone has to open every one.

Now write on each box what's inside: *Kitchen: plates*, *Bathroom*, *Books*. The boxes look no different, but anyone can carry them to the right room without opening them.

HTML elements are the labels. A **semantic** element is one whose name says what's inside it: `<nav>` holds the menu, `<main>` holds the main content, `<strong>` holds words that matter. Screen readers, search engines and the next developer to open your file all read those labels.

## Meaning, not looks

In the early days of the web, HTML was used like a word processor. You chose elements for how they looked: `<b>` for **bold**, `<i>` for *italics*, `<u>` for underlined, `<center>` to center a line. Those tags said nothing about *why* the words were bold or centered.

HTML grew up. In the lesson *Bold, Italic and What They Mean* you met the elements that say why:

- When the words are **important**, use `<strong>`. The browser still shows them in bold, but now the HTML itself says they matter, and a screen reader can tell.
- When the words are **stressed**, the way you'd lean on a word when you say it aloud, use `<em>`.
- `<b>` and `<i>` still exist, with narrower meanings: `<b>` draws the eye without saying the words matter more, and `<i>` marks a different voice, such as a word in another language.
- Underlining and centering are about looks only, so they belong in CSS. `<center>` is obsolete, and the HTML checker reports it as an error.

```text
<b>       (it's important)   ->  <strong>
<i>       (it's stressed)    ->  <em>
<u>       (to underline)     ->  CSS: text-decoration
<center>  (to center)        ->  CSS: text-align
```

The rule of thumb: HTML **describes** the content, and CSS **decides** how it looks.

## From boxes with ids to regions with names

For years, every part of a page was built from `<div>`, a box with no meaning at all. The only label was an `id` that the developer made up:

```html
<body>
  <div id="nav">Menu</div>
  <div id="header">The Corner Bakery</div>
  <div id="left">Today's specials</div>
  <div id="main">Our breads and cakes</div>
  <div id="footer">Open 7 a.m. to 3 p.m.</div>
</body>
```

The page looked something like this:

![A page laid out in boxes: navigation across the top, then a page header, a column of links on the left beside the main content, and a footer at the bottom](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/09/29c24982159f46349993ab72514f10f0.png "Basic page design")

A person can guess what `id="nav"` means, but a screen reader can't: to it, every one of those boxes is the same plain box. HTML now has an element for each of these regions, so the same page can be written like this:

```html
<body>
  <nav>Menu</nav>
  <header>The Corner Bakery</header>
  <aside>Today's specials</aside>
  <main>Our breads and cakes</main>
  <footer>Open 7 a.m. to 3 p.m.</footer>
</body>
```

The element names match the old ids almost word for word. The difference is that now everyone can read the labels, not only the person who made them up.

## The semantic elements you'll use most

You'll meet each of these in this course:

- `<header>`: the top of the page or of a section, such as a logo and a title.
- `<nav>`: a block of links for getting around the site.
- `<main>`: the page's main content. A page has one.
- `<aside>`: content beside the main content, such as a list of related links.
- `<article>`: a piece that makes sense on its own, such as a blog post or a news story.
- `<section>`: a group of related content, usually with its own heading.
- `<footer>`: the bottom of the page or of a section, such as contact details and the copyright.
- `<figure>` and `<figcaption>`: a picture and its caption.
- `<details>` and `<summary>`: a box the reader can open and close. `<summary>` is the part that always shows.
- `<mark>`: highlighted text. `<time>`: a date or a time.

A `<div>` is still the right choice when you need a box only for styling and no semantic element fits. The lesson *Div and Span: Boxes with No Meaning* shows when.

**Try it.** Open a page you wrote in Module 1 in VS Code. Find one `<b>` or `<i>`, and ask what it means: important, stressed, or neither? Change it to `<strong>` or `<em>` if that's what it means, and leave it if it isn't. Then look at the page's parts and write, in a comment at the top, which of `<header>`, `<nav>`, `<main>` and `<footer>` it would use. You'll build those regions in the next lessons.

## Check yourself

2 questions to try on the lesson page.

## So what

When your elements say what the content is, screen readers, search engines and the next developer can all understand the page, and CSS is free to make it look any way you like.

## Key terms

- [Semantic HTML](https://www.ask-codey.com/glossary/semantic-html)
- [&lt;strong>](https://www.ask-codey.com/glossary/strong)
- [&lt;header>](https://www.ask-codey.com/glossary/header)
- [&lt;nav>](https://www.ask-codey.com/glossary/nav)
- [&lt;main>](https://www.ask-codey.com/glossary/main)
- [&lt;footer>](https://www.ask-codey.com/glossary/footer)

## Cheat sheets

- [What Semantic HTML Means](https://www.ask-codey.com/cheat-sheets/html-what-semantic-html-means-cheat-sheet)

## Related

- [Bold, Italic and What They Mean](https://www.ask-codey.com/lessons/html-emphasis-and-importance)
- [Header, Nav, Main and Footer](https://www.ask-codey.com/lessons/html-header-nav-main-and-footer)

Source: https://www.ask-codey.com/lessons/html-what-semantic-html-means
