Kelly Mears

Semantic HTML

Using elements for their meaning, so the document conveys structure without extra description.

Design & Interface2 min read203 words15 out · 23 in
also calledSemanticsLandmarks

Semantic HTML means choosing elements for what they mean rather than how they look: a button for something that does a thing, a heading for a heading, a list for a list, a navigation landmark for navigation. The payoff is that meaning is conveyed to browsers, assistive technology, and machines without any additional description.

Concretely, native elements bring behavior that is otherwise expensive to rebuild: focusability, keyboard activation, form participation, correct announcement, and platform conventions that vary by operating system. Reimplementing that on a generic element is a lot of code that will be subtly wrong, which is why ARIA's first rule is to prefer the native element.

Landmarks — header, navigation, main, footer, and named regions — give screen-reader users a structural map they can jump around. They are also easy to get wrong through duplication: several cards each using a footer element produce several page-level footer landmarks, which an automated check will correctly flag. The fix is usually to nest them inside a sectioning element so each footer belongs to its own region.

Semantics also help outside accessibility. A well-structured document is what makes reader modes, link previews, search indexing, and content extraction work; see Structured Data and Search Engine Optimization.

See also12

UI Primitive

The small set of typed components through which all interface markup is expressed.

Design & Interface12 connections

Headless Component

A component supplying behavior and accessibility with no styling of its own.

Design & Interface16 connections

Accessibility

Designing so that people with disabilities can use a thing, and the standards that make it checkable.

Design & Interface44 connections

Document Object Model

The live tree of objects a browser builds from a document, and the surface every UI framework writes to.

Web Platform27 connections

Progressive Enhancement

Building so the core experience works without scripts, with richer behavior layered on top.

Web Platform26 connections

Keyboard Navigation

Making every interactive affordance reachable and operable without a pointer.

Design & Interface34 connections

Focus Management

Deliberately controlling which element receives keyboard focus as an interface changes.

Design & Interface28 connections

Accordion

A stack of headings that each expand to reveal a section of content, saving space on long pages and small screens at the cost of hiding what readers might have needed to see.

Design & Interface12 connections

Breadcrumb

The short row of links near the top of a page that shows where it sits in a site's hierarchy, such as Home › Shoes › Running, letting people orient themselves and step back up a level in one click.

Design & Interface10 connections

Data Table

Rows and columns of values designed for looking things up and comparing exact figures, which read best with right-aligned numbers, light rules, and headers that stay put, and remain one of the hardest components to make work on a phone.

Design & Interface11 connections

Alt Text

The short text that stands in for an image for people who can't see it, read aloud by screen readers and shown when images fail, which works best when it describes what the image is for rather than what it looks like.

Design & Interface10 connections

Toggle Switch

An on-screen control for a single on-or-off setting that takes effect immediately, borrowed from light switches, distinct from checkboxes and radio buttons, and notorious for leaving people unsure which state it is in.

Design & Interface11 connections

Linked from23