Semantic structure
Exercise30 min
Semantic structure
HTML gives you specific boxes for specific meanings: <nav> for navigation, <main> for the primary content, <article> for a self-contained piece, <footer> for the bottom of the page.
Why does it matter? Two reasons:
- Screen readers navigate by these landmarks. Semantics is accessibility.
- Search engines and future teammates read structure the same way.
Rule of thumb: if you are choosing between <div> and a semantic element and the box has a meaning, use the semantic one. Reserve <div> and <span> for boxes that mean nothing beyond grouping.
Exercise
Take your page from the last lesson and restructure it with <header>, <nav>, <main>, <article>, and <footer>. The look should not change.
Practice in the diagram lab
This lesson's practice belongs in the diagram editor — design the schema you just read about, grade it against the solution, and save it to your account.
Open the diagram lab