HTML & CSS
/Intermediate
Semantic HTML
Definition
The use of HTML markup to reinforce the semantics, or meaning, of the information in webpages rather than merely defining its presentation or look.
Explain Like I'm New
You can build an entire website using only `<div>` tags. Visually, it might look perfect. But a blind person using a screen reader won't know where the navigation bar is, and Google's search engine won't know what part of the page is the main article. Semantic HTML uses specific tags like `<nav>`, `<article>`, and `<footer>` so machines understand your website.
Real World Example
Replacing a `<div class="navigation">` with a `<nav>` tag. They look exactly the same to a sighted user, but the `<nav>` tag drastically improves SEO and Accessibility.
Common Use Cases
- •Improving SEO rankings
- •Making websites accessible for visually impaired users
Interactive Example
Interview Questions
basic
- Name three semantic HTML5 tags.
intermediate
- Why is it bad practice to use a `<div>` for a button?