header
Introductory content for a page or section.
Learn Semantic HTML with practical examples for structure, layout semantics, metadata, embedded content, scripts, accessibility, SEO and live practice.
HTML structure and layout
Semantic HTML means choosing elements that express meaning. A nav is navigation. A button is an action. An article is standalone content. A footer closes a section or page.
Semantic markup improves accessibility, SEO, maintainability and collaboration. It gives the browser more truth about the document.
The goal is not to use every semantic element everywhere. The goal is to choose the most honest element for the content.
Introductory content for a page or section.
Navigation links.
Primary page content.
Thematic sections and standalone content.
Syntax and structure
If an element name describes the content honestly, it is often better than a generic div.
<article class="lesson-card"> <h2>HTML Tables</h2> <p>Learn how tabular data works.</p> <a href="/html/tables.php">Open lesson</a> </article>
<div class="article"> <div class="title">HTML Tables</div> <div class="text">Learn how data works.</div> </div>
Rules that matter
Layout-focused HTML is strongest when meaning, grouping, metadata and behavior hooks all have a clear reason to exist.
Use button for actions and a for navigation.
A large bold div is not a heading.
header, nav, main, aside and footer create useful page regions.
Do not use section or article when a simple div is more honest.
Future developers should understand the page without reading all CSS.
If you cannot explain why an element fits, reconsider it.
Production thinking
This matters because the best HTML is honest. It lets people, browsers and machines understand the page before visual design is applied.
Semantic elements give assistive technology useful roles and navigation points without extra ARIA.
Semantic HTML makes components easier to test, style and refactor because the markup says what it is.
Search engines reward clear content and structure. Semantic HTML supports that clarity without keyword tricks.
Live code lab
Edit the HTML or CSS, then use Run to refresh the preview. The preview is isolated, so links and forms stay inside this practice area.
Mini assignment
Practice assignment
Try it yourself
Self-check
Do not only read this page. Answer these questions out loud or write the answers in your own notes. If one answer feels vague, revisit the examples before moving on.