HTML, CSS & JS, lesson 3
You could build a whole page out of <div>s, but HTML has semantic elements that say what
each part is. Screen readers use them to let people jump around, search engines use them to
understand content, and they make your own code easier to read.
<header>
<h1>Pancake Club</h1>
<nav>
<a href="/">Home</a>
<a href="/recipes">Recipes</a>
</nav>
</header>
<main>
<article>
<h2>Buttermilk pancakes</h2>
<p>Tangy, tall and tender.</p>
</article>
</main>
<footer>
<p>Made with butter.</p>
</footer><header>: introductory content, usually the site name and navigation.<nav>: a group of the main navigation links.<main>: the main content. A page should have one <main>.<section>: a themed part of the page, normally with its own heading.<article>: something that would make sense on its own, like a blog post or a product card.<footer>: closing information such as contact links or copyright.<div> and its inline cousin <span> mean nothing on their own. They are useful when you need
a box only for styling or scripting, with no meaning to add. Reach for a semantic element first,
and fall back to <div> when none fits.
One exercise to try what you just read.