# Semantic HTML: Meaningful Markup for Accessibility

Source: https://allyway.ai/glossary/semantic-html

Semantic HTML means marking up content with the elements that describe its meaning, such as h1–h6, nav, button or table. It lets assistive technology understand structure and relationships, as WCAG 1.3.1 requires.

Semantic HTML means choosing each element for what the content is, not for how it should look: a heading is an `h2`, a list is a `ul`, a button is a `button`. Browsers pass that meaning on to screen readers, voice control and search engines. A page built only from styled `div` elements may look the same, but to assistive technology it is a flat stream of text.

## What it means

Semantic markup is the main way to meet [WCAG 1.3.1 Info and Relationships](https://www.w3.org/WAI/WCAG22/Understanding/info-and-relationships.html), a Level A criterion of [WCAG 2.2](https://allyway.ai/regulations/wcag-2-2). It requires that information, structure and relationships conveyed through presentation can be programmatically determined or are available in text. If something looks like a heading, a list, a table or a field label, the code has to say so too – see [info and relationships](https://allyway.ai/glossary/info-and-relationships).

W3C's sufficient techniques for 1.3.1 are mostly plain HTML elements:

| Visual structure | Semantic HTML | W3C technique |
|---|---|---|
| Headings | `h1`–`h6` | H42 |
| Lists and groups of links | `ul`, `ol`, `dl` | H48 |
| Data tables | `table`, `th`, `caption`, `scope` | H51, H39, H63 |
| Field labels | `label for="…"` | H44 |
| Page regions | `header`, `nav`, `main`, `footer` | H101 |

The failures are the reverse: changing text presentation to convey information without markup (F2), using structural markup that doesn't match the relationships (F43), and `role="presentation"` on content that has meaning (F92). W3C also lists F42 – a `span` or `div` made to act like a link with a script.

> **Tip:** > **HTML first, ARIA second**
> [ARIA](https://allyway.ai/glossary/aria) can add roles to elements that have none, but a native element brings its role, keyboard behavior and states for free. A `button` is focusable and works with Enter and Space; a `div role="button"` needs all of that built by hand.

Who benefits: [screen reader](https://allyway.ai/glossary/screen-reader) users, who jump between headings, landmarks and lists; keyboard users, who reach native controls without extra code; and voice control users, who say "click Send" and need a real button with that name.

## Examples

The same card, once built from generic boxes and once with semantic elements:

```html title="Example"
<!-- Without semantics: looks fine, means nothing -->
<div class="title">Our services</div>
<div class="item">Web design</div>
<div class="item">Hosting</div>
<div class="btn" onclick="send()">Send request</div>

<!-- Semantic HTML: same look with CSS, real structure -->
<section aria-labelledby="services">
  <h2 id="services">Our services</h2>
  <ul>
    <li>Web design</li>
    <li>Hosting</li>
  </ul>
  <button type="button" onclick="send()">Send request</button>
</section>
```

**Do:** Do

Pick elements by meaning and style them with CSS. Use one `main`, a `nav` for menus and a logical [heading structure](https://allyway.ai/glossary/heading-structure). Mark up data tables with `th` and captions. Use `a href` for navigation and `button` for actions.

**Don't:** Don't

Build headings from bold text, lists from line breaks or buttons from `div`s. Use tables for layout. Skip heading levels to get a smaller font. Add ARIA roles to fix markup you could simply replace with the right element.

## How to check semantic HTML



## Questions

Q: What is semantic HTML in simple terms?
A: Using the HTML element that matches what the content is: `h1` for the main heading, `nav` for navigation, `button` for a button. The element carries meaning that browsers and assistive technology can read, independent of the visual design.

Q: Why is semantic HTML important for accessibility?
A: Screen readers announce elements by their role and let users jump by headings, landmarks and lists. Without semantic markup, that structure exists only visually, so WCAG 1.3.1 fails and people who cannot see the layout lose orientation.

Q: Is a div with an ARIA role as good as a native element?
A: It can be made equivalent, but only if you add focus handling, keyboard support and states yourself. Native elements bring all of this, so the usual rule is to use HTML elements first and ARIA only where no element fits.

Q: Does semantic HTML help SEO?
A: Search engines use headings, lists and landmarks to understand a page, and clean markup makes content easier to extract. Accessibility is the stronger reason, though: it decides whether people can use the page at all.

Q: How can I find markup problems on my website?
A: The accessibility tree in DevTools shows what assistive technology sees. For a quick overview, the [free WCAG scanner](https://allyway.ai/free-wcag-accessibility-scanner-for-websites) checks your homepage for issues like missing labels and heading errors.
