--- url: "https://web.dev/learn/html/semantic-html" titulek: "Semantic HTML | web.dev" h1: "Semantic HTML Stay organized with collections Save and categorize content based on your preferences." popis: "Using the correct HTML elements to describe your document content." jazyk: "en" kanonicka: "https://web.dev/learn/html/semantic-html" drobecky: ["web.dev", "Resources", "HTML"] zdroj: "live" wayback_snapshot: "" stazeno: "2026-09-14 02:42:37" znaku: 10155 slov: 1546 kodovani: "iso-8859-2" sha256: "2b6f2930f0cdec2111838cb4c0e61043383c9d5b38463f5eb7eb051143e788a9" --- Semantic HTML Stay organized with collections Save and categorize content based on your preferences. With over 100 HTML elements and the ability to create custom elements, there are infinite ways to mark up your content. But, some ways—notably *semantically*—are better than others. *Semantic* means "relating to meaning". Writing semantic HTML means using HTML elements to structure your content based on each element's meaning, not its appearance. This series hasn't covered many HTML elements yet, but even without knowing HTML, the following two code snippets show how semantic markup can give content context. Both use a word count instead of *ipsum lorem* to save some scrolling—use your imagination to expand "thirty words" into 30 words: The first code snippet uses `
` and ``, two elements with no semantic value. `
Three words
one word one word one word one word
five words
three words
forty-six words
forty-four words
seven words
sixty-eight words
forty-four words
five words
` Do you get a sense of what those words expand to? Not really. Let's rewrite this code with semantic elements: `

Three words

five words

three words

forty-six words

forty-four words

seven words

sixty-eight words

forty-four words

five words

` Which code block conveyed meaning? Using only the non-semantic elements of `
` and ``, you really can't tell what the content in the first code block represents. The second code example, with semantic elements, provides enough context for a non-coder to decipher the purpose and meaning without having ever encountered an HTML tag. It definitely provides enough context for the developer to understand the outline of the page, even if they don't understand the content, such as content in a foreign language. In the second code block, we can understand the architecture even without understanding the content because semantic elements provide meaning and structure. You can tell that the first header is the site's banner, with the `

` likely to be the site name. The footer is the site footer: the five words may be a copyright statement or business address. Semantic markup isn't just for making markup easier for developers to read; it's mostly important in helping automated tools decipher markup. Developer tools demonstrate how semantic elements provide machine-readable structure as well. Accessibility object model (AOM) As the browser parses the content received, it builds the document object model (DOM) and the CSS object model (CSSOM). It then also builds an [accessibility tree](/learn/accessibility/aria-html#the_accessibility_tree). Assistive devices, such as screen readers, use the AOM to parse and interpret content. The DOM is a tree of all the nodes in the document. The AOM is like a semantic version of the DOM. Let's compare how both of these document structures are rendered in the Firefox accessibility panel: Figure 1. A list of nodes which are all links or text. Figure 2. A list of nodes with clear landmarks. In figure 2, there are four landmark roles in the second code block. It uses semantic landmarks conveniently named `
`, `
`, `