A div can contain text but does not explain its purpose. Semantics means the meaning an element conveys. Semantic HTML chooses elements according to the content's role so people, browsers and assistive tools can understand it.
Similar appearance does not imply the same meaning
A div saying Schedule is text, not a heading. h2 explicitly identifies a heading that screen readers can include in heading navigation. An a with href supplies link behavior; button supplies button semantics and keyboard interaction. A class named button does not turn ordinary text into a button.
<h2>Join the event</h2>
<p>Read the information before registering.</p>
<a href="#registration">Go to registration</a>This expresses heading, explanation and navigation without decorative styling. Semantic HTML is about appropriate elements, not more elements. Meaningful elements can still have classes and CSS styling later.
Meaningful page regions
header introduces a page or part of it, nav contains major navigation, main contains the page's primary content and footer contains closing information. The next lesson combines these with section, article and aside in a complete page.
For an ordinary page, use one visible main for its unique primary content, with repeated site navigation and footer outside. Replacing div with main may barely change the default appearance while making the source more meaningful.
Check by interacting
Compare the Lab's generic containers with the semantic version. Use Tab to reach the registration link and Enter to follow it. Ordinary div text is not automatically part of that keyboard interaction order.
Semantics is one accessibility foundation, not a complete solution. Images still need suitable alt text, forms need labels, headings need hierarchy and colors need readable contrast. These practices work together.
Page experiment: Semantic HTML
Compare the examples, then change one part of the HTML using the observation prompt. Compare the source with the real rendered page.
The words display, but Go to registration is not a link and lacks link keyboard behavior.
The preview uses native browser headings, paragraphs and form controls. Switching examples replaces your edits; Reset lab restores the initial state. Follow in-page links, type and select options. This practice preview does not send form data or run scripts. To try locally, save the complete code as index.html and open it in a browser.
KNOWLEDGE QUIZ
Build it yourself: Semantic HTML
Create index.html, write a complete page using the requirements below, then save and open it in a browser. Interact with the page to check it. The reference is one possible implementation; wording may differ.
- Refactor a div-only introduction into header, main and footer with meaningful headings and paragraphs.
- Add a real link to an id inside main and check it with Tab and Enter.