semantic HTML

Using HTML elements for their meaning, such as <button> for actions and <nav> for navigation, rather than generic <div>s.

In more detail

Semantic elements come with roles, keyboard support and focus behaviour built in, and assistive technology already understands them. Custom widgets should start from them and add ARIA only where HTML has no equivalent.

Examples

In the browser: Semantic elements carry built-in meaning that browsers, screen readers and search engines understand, often including an implicit ARIA role. A page built only from div elements looks fine but gives assistive technology nothing to navigate by.
Polymorphic React components let callers pick the right semantic tag instead of forcing a generic div.

Related terms

Taught in

References