Semantic HTML
Semantic HTML is the practice of using HTML tags that clearly describe the purpose or meaning of the content they contain, rather than tags that only affect appearance. For example, a heading element signals that its text is a heading, giving that text a defined role. This makes web content more understandable to browsers, assistive technologies, and other tools that interpret the page.
Semantic HTML refers to authoring markup with elements chosen for their inherent meaning and role rather than for presentation alone. Elements such as the h1 heading convey a defined role to the text they wrap, allowing user agents, assistive technologies, and search engines to interpret the structure and intent of content. This contrasts with non-semantic or generic 'tag soup' markup, where elements carry no meaning about the content they enclose. Correct use of semantic elements commonly supports accessibility and search engine optimization by exposing meaningful document structure.
Why it matters
Semantic HTML matters because assistive technologies rely on the meaning conveyed by markup to interpret and navigate a page. When elements are chosen for their inherent role rather than for appearance alone, a screen reader can announce a heading as a heading, allowing users to understand document structure and move through content efficiently. Generic or presentational markup that carries no meaning about the content it encloses offers assistive technologies far less to work with, which can make a page harder or impossible to use for people who depend on those tools.
Beyond accessibility, semantic markup exposes meaningful document structure to a range of user agents and tools, including search engines. Using elements with meaningful names and purposes commonly supports both accessibility and search engine optimization by making the intent and organization of content more understandable to software that interprets the page.
It is important to note that using semantic HTML is one practice among many and does not by itself guarantee an accessible experience or conformance with any particular standard. Meaningful markup supports the structural foundation that accessibility depends on, but manual testing and testing with assistive technologies remain necessary to confirm that content works for real users. This entry is general guidance and not legal advice.
Who it's relevant to
Inside Semantic HTML
Common questions
Answers to the questions practitioners most commonly ask about Semantic HTML.