{"id":946,"date":"2026-11-28T15:00:03","date_gmt":"2026-11-28T15:00:03","guid":{"rendered":"https:\/\/html-editor-online.com\/blog?p=946"},"modified":"2026-11-28T15:00:03","modified_gmt":"2026-11-28T15:00:03","slug":"semantic-html-elements-explained","status":"publish","type":"post","link":"https:\/\/html-editor-online.com\/blog\/semantic-html-elements-explained\/","title":{"rendered":"Semantic HTML Elements Explained: What They Are and When to Use Each One"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">What is semantic HTML? It means choosing an element for the job the content does, such as navigation, main content or closing information, instead of wrapping everything in a generic <code>&lt;div&gt;<\/code>. Semantic HTML elements make source code easier to read and can expose page structure to assistive technology, but they do not make a page accessible on their own.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The input is plain HTML and the outcome is a small page whose structure you can explain element by element. Below I give a decision guide for each main element, one complete page, the mistakes I see most often and a short exercise. You can write the page in the <a href=\"https:\/\/html-editor-online.com\/editors\/html\" title=\"HTML Code Editor\">HTML Code Editor<\/a>, compare it with the sandboxed live preview and tidy the nesting with the HTML Beautifier.<\/p>\n\n\n\n<div class=\"wp-block-rank-math-toc-block\" id=\"rank-math-toc\"><h2>Table of Contents<\/h2><nav><ul><li class=\"\"><a href=\"#what-semantic-html-elements-are-and-why-they-matter-1\">What Semantic HTML Elements Are and Why They Matter<\/a><\/li><li class=\"\"><a href=\"#a-decision-guide-to-the-main-semantic-html-elements-2\">A Decision Guide to the Main Semantic HTML Elements<\/a><\/li><li class=\"\"><a href=\"#a-complete-small-page-built-from-semantic-html-elements-3\">A Complete Small Page Built From Semantic HTML Elements<\/a><\/li><li class=\"\"><a href=\"#common-semantic-html-mistakes-and-how-to-spot-them-4\">Common Semantic HTML Mistakes and How to Spot Them<\/a><\/li><li class=\"\"><a href=\"#write-preview-and-tidy-semantic-html-elements-in-the-editor-5\">Write, Preview and Tidy Semantic HTML Elements in the Editor<\/a><\/li><li class=\"\"><a href=\"#frequently-asked-questions\">Frequently asked questions<\/a><\/li><li class=\"\"><a href=\"#next-steps\">Next steps<\/a><\/li><li class=\"\"><a href=\"#sources\">Sources and further reading<\/a><\/li><\/ul><\/nav><\/div>\n\n\n<div class=\"wp-block-image heo-auto-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/html-editor-online.com\/blog\/wp-content\/uploads\/2026\/11\/semantic-html-elements-image-1-909-1-d758f8c91cbece9d-1024x576.jpg\" alt=\"Identical generic crates being sorted into distinct purpose-built containers, representing generic div wrappers replaced by semantic HTML elements\" class=\"wp-image-951\" srcset=\"https:\/\/html-editor-online.com\/blog\/wp-content\/uploads\/2026\/11\/semantic-html-elements-image-1-909-1-d758f8c91cbece9d-1024x576.jpg 1024w, https:\/\/html-editor-online.com\/blog\/wp-content\/uploads\/2026\/11\/semantic-html-elements-image-1-909-1-d758f8c91cbece9d-300x169.jpg 300w, https:\/\/html-editor-online.com\/blog\/wp-content\/uploads\/2026\/11\/semantic-html-elements-image-1-909-1-d758f8c91cbece9d-768x432.jpg 768w, https:\/\/html-editor-online.com\/blog\/wp-content\/uploads\/2026\/11\/semantic-html-elements-image-1-909-1-d758f8c91cbece9d.jpg 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"what-semantic-html-elements-are-and-why-they-matter-1\">What Semantic HTML Elements Are and Why They Matter<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Semantic HTML elements are elements whose names describe the role of their content. A <code>&lt;nav&gt;<\/code> holds navigation, a <code>&lt;footer&gt;<\/code> holds closing information and a <code>&lt;p&gt;<\/code> holds a paragraph. A <code>&lt;div&gt;<\/code> says nothing about its content, so it is the right choice only when no more specific element fits. The goal is not to remove every <code>&lt;div&gt;<\/code>. It is to stop using one when the purpose of the block is already known.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here is the same fictional page fragment, first with generic wrappers and then with elements chosen for meaning.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"html\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;div class=&quot;page-top&quot;&gt;\n  &lt;div class=&quot;links&quot;&gt;\n    &lt;a href=&quot;\/&quot;&gt;Home&lt;\/a&gt;\n    &lt;a href=&quot;\/guides&quot;&gt;Guides&lt;\/a&gt;\n  &lt;\/div&gt;\n&lt;\/div&gt;\n&lt;div class=&quot;content&quot;&gt;\n  &lt;div class=&quot;post&quot;&gt;\n    &lt;div class=&quot;post-title&quot;&gt;Rinsing rice&lt;\/div&gt;\n    &lt;p&gt;Rinse until the water runs clear.&lt;\/p&gt;\n  &lt;\/div&gt;\n&lt;\/div&gt;\n&lt;div class=&quot;page-end&quot;&gt;Updated 23 November 2026&lt;\/div&gt;<\/pre>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"html\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;header&gt;\n  &lt;nav&gt;\n    &lt;ul&gt;\n      &lt;li&gt;&lt;a href=&quot;\/&quot;&gt;Home&lt;\/a&gt;&lt;\/li&gt;\n      &lt;li&gt;&lt;a href=&quot;\/guides&quot;&gt;Guides&lt;\/a&gt;&lt;\/li&gt;\n    &lt;\/ul&gt;\n  &lt;\/nav&gt;\n&lt;\/header&gt;\n&lt;main&gt;\n  &lt;h1&gt;Kitchen basics&lt;\/h1&gt;\n  &lt;article&gt;\n    &lt;h2&gt;Rinsing rice&lt;\/h2&gt;\n    &lt;p&gt;Rinse until the water runs clear.&lt;\/p&gt;\n  &lt;\/article&gt;\n&lt;\/main&gt;\n&lt;footer&gt;\n  &lt;p&gt;Updated 23 November 2026&lt;\/p&gt;\n&lt;\/footer&gt;<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">With CSS applied, both versions can look the same. The difference is in the meaning. The post title is now a real heading instead of a styled <code>&lt;div&gt;<\/code>, the links sit in a list inside a navigation element and the closing line lives in a footer. A browser, an assistive technology and the next developer can all read that structure without guessing from class names. This is the benefit the HTML Standard and MDN describe: clearer source and structure that tools can expose. I make no claim about search rankings, because none of the sources I checked promise one.<\/p>\n\n\n<div class=\"wp-block-image heo-auto-image\">\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6b0b918ee56b8&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6b0b918ee56b8\" class=\"aligncenter size-large wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/html-editor-online.com\/blog\/wp-content\/uploads\/2026\/11\/semantic-html-elements-image-2-909-2-f73c3b0ede915f5d-1024x576.jpg\" alt=\"Color-coded layout panels representing the main semantic HTML elements and their roles on a page\" class=\"wp-image-953\" srcset=\"https:\/\/html-editor-online.com\/blog\/wp-content\/uploads\/2026\/11\/semantic-html-elements-image-2-909-2-f73c3b0ede915f5d-1024x576.jpg 1024w, https:\/\/html-editor-online.com\/blog\/wp-content\/uploads\/2026\/11\/semantic-html-elements-image-2-909-2-f73c3b0ede915f5d-300x169.jpg 300w, https:\/\/html-editor-online.com\/blog\/wp-content\/uploads\/2026\/11\/semantic-html-elements-image-2-909-2-f73c3b0ede915f5d-768x432.jpg 768w, https:\/\/html-editor-online.com\/blog\/wp-content\/uploads\/2026\/11\/semantic-html-elements-image-2-909-2-f73c3b0ede915f5d.jpg 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"a-decision-guide-to-the-main-semantic-html-elements-2\">A Decision Guide to the Main Semantic HTML Elements<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Use this table to pick an element by asking what the content is. If none of the rows fits, a <code>&lt;div&gt;<\/code> or <code>&lt;span&gt;<\/code> is still correct.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Element<\/th><th>Use it for<\/th><th>Avoid it when<\/th><\/tr><\/thead><tbody><tr><td><code>&lt;header&gt;<\/code><\/td><td>Introductory content or navigational aids for a page, article or section, such as a title and a menu<\/td><td>You mean document metadata, which belongs in <code>&lt;head&gt;<\/code><\/td><\/tr><tr><td><code>&lt;nav&gt;<\/code><\/td><td>A significant block of navigation, such as a main menu or a table of contents<\/td><td>You have only a few incidental links in a paragraph<\/td><\/tr><tr><td><code>&lt;main&gt;<\/code><\/td><td>The dominant, page-specific content<\/td><td>The content repeats across pages, or another visible <code>&lt;main&gt;<\/code> already exists<\/td><\/tr><tr><td><code>&lt;article&gt;<\/code><\/td><td>A self-contained item that makes sense on its own, such as a post, a comment or a product card<\/td><td>The block only makes sense inside its surroundings<\/td><\/tr><tr><td><code>&lt;section&gt;<\/code><\/td><td>A distinct topic, normally with a heading, when no more specific element fits<\/td><td>You only need a wrapper for layout or styling<\/td><\/tr><tr><td><code>&lt;aside&gt;<\/code><\/td><td>Tangentially related content, such as a related-reading box<\/td><td>The content is central, or is merely placed at the side visually<\/td><\/tr><tr><td><code>&lt;footer&gt;<\/code><\/td><td>Closing information for the page or the nearest relevant section, such as authorship or copyright<\/td><td>You want a layout bar with no closing role<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Two distinctions cause most confusion. First, the visible <code>&lt;header&gt;<\/code> element is different from <code>&lt;head&gt;<\/code>. The head holds the title, character set and other metadata that is not rendered as page content. Second, an <code>&lt;article&gt;<\/code> and a <code>&lt;section&gt;<\/code> are not interchangeable. If you could lift the block into a feed or another site and it would still make sense, it is an article. If it is one themed part of a larger piece, it is a section.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Elements nest according to purpose. A page can have a page-level header and footer, and each article can have its own header, sections and footer too.<\/p>\n\n\n<div class=\"wp-block-image heo-auto-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/html-editor-online.com\/blog\/wp-content\/uploads\/2026\/11\/semantic-html-elements-image-3-909-3-c0d294c43a85b188-1024x576.jpg\" alt=\"Cutaway model of a building with distinct rooms, illustrating a page structured with header, main, aside and footer elements\" class=\"wp-image-955\" srcset=\"https:\/\/html-editor-online.com\/blog\/wp-content\/uploads\/2026\/11\/semantic-html-elements-image-3-909-3-c0d294c43a85b188-1024x576.jpg 1024w, https:\/\/html-editor-online.com\/blog\/wp-content\/uploads\/2026\/11\/semantic-html-elements-image-3-909-3-c0d294c43a85b188-300x169.jpg 300w, https:\/\/html-editor-online.com\/blog\/wp-content\/uploads\/2026\/11\/semantic-html-elements-image-3-909-3-c0d294c43a85b188-768x432.jpg 768w, https:\/\/html-editor-online.com\/blog\/wp-content\/uploads\/2026\/11\/semantic-html-elements-image-3-909-3-c0d294c43a85b188.jpg 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"a-complete-small-page-built-from-semantic-html-elements-3\">A Complete Small Page Built From Semantic HTML Elements<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This fictional hiking page puts every element from the table to work. Copy it as it is, because the next section builds on it.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"html\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;!DOCTYPE html&gt;\n&lt;html lang=&quot;en&quot;&gt;\n&lt;head&gt;\n  &lt;meta charset=&quot;utf-8&quot;&gt;\n  &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&gt;\n  &lt;title&gt;Trail Notes: Spring Hikes&lt;\/title&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n  &lt;header&gt;\n    &lt;h1&gt;Trail Notes&lt;\/h1&gt;\n    &lt;nav aria-label=&quot;Primary&quot;&gt;\n      &lt;ul&gt;\n        &lt;li&gt;&lt;a href=&quot;\/&quot;&gt;Home&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li&gt;&lt;a href=&quot;\/hikes&quot;&gt;Hikes&lt;\/a&gt;&lt;\/li&gt;\n      &lt;\/ul&gt;\n    &lt;\/nav&gt;\n  &lt;\/header&gt;\n  &lt;main&gt;\n    &lt;article&gt;\n      &lt;header&gt;\n        &lt;h2&gt;Spring hikes near the river&lt;\/h2&gt;\n        &lt;p&gt;Posted &lt;time datetime=&quot;2026-04-12&quot;&gt;12 April 2026&lt;\/time&gt;&lt;\/p&gt;\n      &lt;\/header&gt;\n      &lt;section&gt;\n        &lt;h3&gt;Packing list&lt;\/h3&gt;\n        &lt;p&gt;Water, a light jacket and sturdy shoes.&lt;\/p&gt;\n      &lt;\/section&gt;\n      &lt;section&gt;\n        &lt;h3&gt;Route notes&lt;\/h3&gt;\n        &lt;p&gt;The loop takes about two hours at an easy pace.&lt;\/p&gt;\n      &lt;\/section&gt;\n    &lt;\/article&gt;\n    &lt;aside&gt;\n      &lt;h2&gt;Related reading&lt;\/h2&gt;\n      &lt;p&gt;Choosing a day pack for short trips.&lt;\/p&gt;\n    &lt;\/aside&gt;\n  &lt;\/main&gt;\n  &lt;footer&gt;\n    &lt;p&gt;Written by a fictional hiker.&lt;\/p&gt;\n  &lt;\/footer&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">A few choices are worth explaining. The <code>&lt;header&gt;<\/code> and <code>&lt;footer&gt;<\/code> that are direct children of the body describe the whole page, so they can be exposed as the page-level banner and content information landmarks. The <code>&lt;header&gt;<\/code> inside the article is not a page banner. It simply introduces that article. There is one visible <code>&lt;main&gt;<\/code>, and it holds the article plus a related aside.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Headings are still your decision. Sectioning elements do not assign levels, so I picked <code>&lt;h1&gt;<\/code> for the page, <code>&lt;h2&gt;<\/code> for the article and <code>&lt;h3&gt;<\/code> for its sections. For heading sequence in the visual editor, see the guide on <a href=\"https:\/\/html-editor-online.com\/blog\/wysiwyg-heading-levels-out-of-order\/\" title=\"WYSIWYG Heading Levels Out of Order\">WYSIWYG heading levels out of order<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Landmarks need a little care too. A <code>&lt;section&gt;<\/code> does not become a named region just because it has a heading. It becomes a region landmark only when it has an accessible name, and many sections do not need to be landmarks at all, so I left these plain. When a page has more than one navigation block, give each a distinct label, such as Primary and Footer. The landmark regions page in the W3C ARIA Authoring Practices Guide covers these points in more detail.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"common-semantic-html-mistakes-and-how-to-spot-them-4\">Common Semantic HTML Mistakes and How to Spot Them<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Most problems come from using the right-sounding element for the wrong reason. These are the ones I would check first.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Wrapping every group of links in a nav.<\/strong> A <code>&lt;nav&gt;<\/code> is for significant navigation. A couple of links inside a sentence are just links.<\/li>\n\n\n\n<li><strong>Using several visible main elements.<\/strong> A page has one dominant content area, so use one visible <code>&lt;main&gt;<\/code>.<\/li>\n\n\n\n<li><strong>Using section as a styling hook.<\/strong> If the block has no heading and no thematic identity, a <code>&lt;div&gt;<\/code> is the honest choice.<\/li>\n\n\n\n<li><strong>Calling any sidebar an aside.<\/strong> An aside is defined by its relationship to the content, not by where CSS puts it.<\/li>\n\n\n\n<li><strong>Mixing up header and head.<\/strong> The <code>&lt;head&gt;<\/code> holds metadata such as the title. For related reading on the document structure around it, see <a href=\"https:\/\/html-editor-online.com\/blog\/html-live-preview-title-not-showing-in-browser-tab\/\" title=\"HTML Live Preview Title Not Showing in Browser Tab\">HTML live preview title not showing in browser tab<\/a> and <a href=\"https:\/\/html-editor-online.com\/blog\/wysiwyg-html-download-missing-doctype-head-body\/\" title=\"WYSIWYG HTML Download Missing Doctype Head Body\">WYSIWYG HTML download missing doctype head body<\/a>.<\/li>\n\n\n\n<li><strong>Adding redundant ARIA roles.<\/strong> Writing <code>role=\"navigation\"<\/code> on a <code>&lt;nav&gt;<\/code> only restates what the element already means, so leave it out.<\/li>\n\n\n\n<li><strong>Treating semantics as a finished accessibility job.<\/strong> Elements do not replace alt text, form labels, keyboard support or sufficient contrast.<\/li>\n\n\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">A useful habit is to read the document with CSS in mind but without it. Ask what each block is, name it in one phrase and see whether an element with that meaning exists.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"write-preview-and-tidy-semantic-html-elements-in-the-editor-5\">Write, Preview and Tidy Semantic HTML Elements in the Editor<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This exercise turns the examples into something you can inspect. As of November 23, 2026, the editor page describes syntax highlighting, auto-closing tags, a sandboxed live preview and beautify or minify options, and it states that it has no validation.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Open the HTML Code Editor and paste the generic-wrapper version from the first example, or an old fragment of your own.<\/li>\n\n\n\n<li>Rewrite it with one page header, a primary main area, an article with its own header and two headed sections, an optional aside and a page footer. Use the decision table to justify each choice.<\/li>\n\n\n\n<li>Compare your source with the live preview. Expect it to look plain. Semantic elements carry meaning more than appearance, so the structure lives in the source, not in the preview.<\/li>\n\n\n\n<li>Run the markup through the beautify option in the editor or through the <a href=\"https:\/\/html-editor-online.com\/tools\/html_beautifier\" title=\"HTML Beautifier\">HTML Beautifier<\/a> so the indentation shows the nesting. Check that each opening tag lines up with its closing tag and that every section sits inside the element you intended.<\/li>\n\n\n\n<li>Check the result outside the editor: run it through an external HTML validator such as the W3C Nu HTML Checker, tab through the links with the keyboard and, if you can, listen to it with a screen reader.<\/li>\n\n\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Keep the limits in mind. A preview that looks right proves only that it looks right. It does not show that the markup is valid or that the semantic choices are correct. Beautifying changes whitespace and layout of the source. It does not repair invalid code, pick a better element or validate anything. Treat the editor as the place to write and read the structure, and use separate checks for validity and accessibility.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"frequently-asked-questions\">Frequently asked questions<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"faq-1\">What is semantic HTML?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Semantic HTML is the practice of choosing elements for the meaning and purpose of content rather than its appearance. A nav element marks navigation, a footer marks closing information and an article marks a self-contained item. It makes source easier to read and can expose structure to assistive technology, but it does not guarantee accessibility.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"faq-2\">Do semantic HTML elements improve SEO?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">I would not promise a ranking gain. The sources I checked describe benefits for readability, maintenance and assistive technology, and they do not claim search advantages. Treat semantic markup as good engineering that helps people and tools understand the page, and judge any search effect separately.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"faq-3\">Should I replace every div with a semantic element?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">No. A div is still correct when a block needs grouping for styling or scripting and no more specific element describes it. Replace a div when you can name its role, such as navigation or a self-contained post, and leave it when you cannot.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"faq-4\">What is the difference between section and article?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">An article is self-contained and would still make sense if separated from the page, such as a blog post or a comment. A section is a themed part of a larger whole, normally with its own heading. Articles can contain sections, and a page can have several articles.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"faq-5\">Can a page have more than one header or footer?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Yes. Each article or section can have its own header and footer. Only the ones that belong directly to the page body describe the whole page. A header inside an article is not the page-level banner. Use only one visible main element per page.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"faq-6\">Do I need ARIA roles on semantic elements?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Usually not. Native elements already carry their roles, so role=&#8221;navigation&#8221; on a nav adds nothing. Use ARIA only when native HTML cannot express what you need, and give an element an accessible name when a landmark needs to be told apart, such as two navigation blocks.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"faq-7\">Does a correct live preview mean my semantic markup is valid?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">No. A preview shows how the browser rendered your markup, and a browser tolerates many mistakes. It does not check validity, element choice or accessibility. Beautifying only reformats the source. Use an external HTML validator, keyboard testing and, where possible, a screen reader for those checks.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"next-steps\">Next steps<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Semantic HTML elements are a naming decision. Pick the element whose meaning matches the content, keep generic <code>&lt;div&gt;<\/code> and <code>&lt;span&gt;<\/code> wrappers for cases with no better fit and choose heading levels yourself. Remember that structure alone does not make a page accessible, valid or well written. Your next step is to take one page you already built, replace the wrappers whose purpose is clear, then compare source and preview in the editor and validate the result with an external checker.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Related tools and resources on HTML Editor Online:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/html-editor-online.com\/editors\/html\">HTML Code Editor<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/html-editor-online.com\/tools\/html_beautifier\">HTML Beautifier<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/html-editor-online.com\/blog\/wysiwyg-heading-levels-out-of-order\/\">WYSIWYG Heading Levels Out of Order<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/html-editor-online.com\/blog\">Developer Journal<\/a><\/li>\n\n\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"sources\">Sources and further reading<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/html.spec.whatwg.org\/multipage\/sections.html\" target=\"_blank\" rel=\"noopener\">HTML Standard<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.w3.org\/WAI\/ARIA\/apg\/practices\/landmark-regions\/\" target=\"_blank\" rel=\"noopener\">Landmark Regions | APG | WAI | W3C<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Learn_web_development\/Core\/Accessibility\/HTML\" target=\"_blank\" rel=\"noopener\">HTML: A good basis for accessibility &#8211; Learn web development | MDN<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.w3.org\/WAI\/WCAG21\/Techniques\/html\/H101\" target=\"_blank\" rel=\"noopener\">H101: Using semantic HTML elements to identify regions of a page | WAI | W3C<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/html-editor-online.com\/tools\/html_beautifier\">HTML Beautifier<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/html-editor-online.com\/blog\/wysiwyg-heading-levels-out-of-order\/\">WYSIWYG Heading Levels Out of Order<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/html-editor-online.com\/editors\/html\">HTML Code Editor<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTML\/Reference\/Elements\/main\" target=\"_blank\" rel=\"noopener\">HTML main element &#8211; HTML | MDN<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTML\/Reference\/Elements\/head\" target=\"_blank\" rel=\"noopener\">HTML document metadata (header) element &#8211; HTML | MDN<\/a><\/li>\n\n\n<\/ul>\n\n\n","protected":false},"excerpt":{"rendered":"<p>Semantic HTML elements describe what content is, not how it looks. Learn when to use header, nav, main, article, section, aside and footer.<\/p>\n","protected":false},"author":1,"featured_media":950,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[315,314,10,313,316,43],"class_list":["post-946","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-html-tips","tag-accessibility-basics","tag-html-structure","tag-html-tips","tag-html5-elements","tag-landmarks","tag-semantic-html"],"_links":{"self":[{"href":"https:\/\/html-editor-online.com\/blog\/wp-json\/wp\/v2\/posts\/946","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/html-editor-online.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/html-editor-online.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/html-editor-online.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/html-editor-online.com\/blog\/wp-json\/wp\/v2\/comments?post=946"}],"version-history":[{"count":6,"href":"https:\/\/html-editor-online.com\/blog\/wp-json\/wp\/v2\/posts\/946\/revisions"}],"predecessor-version":[{"id":956,"href":"https:\/\/html-editor-online.com\/blog\/wp-json\/wp\/v2\/posts\/946\/revisions\/956"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/html-editor-online.com\/blog\/wp-json\/wp\/v2\/media\/950"}],"wp:attachment":[{"href":"https:\/\/html-editor-online.com\/blog\/wp-json\/wp\/v2\/media?parent=946"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/html-editor-online.com\/blog\/wp-json\/wp\/v2\/categories?post=946"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/html-editor-online.com\/blog\/wp-json\/wp\/v2\/tags?post=946"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}