<main>
Purpose: Contains the primary page content.
How it Works:
One per page. Improves accessibility.
Wrap your page’s primary content in a
<main>...</main>element.
HTML and Javascript, Day 2
2025-09-12
<h1>, <p>, <em>, <strong>, <a>, <img>, <ul>, <li>href and altWithout structure:
<!doctype html>
<html lang="en">
<h1>My Mini Site</h1>
<p>Hello world! ...</p>
<h2>Links</h2>
<p>Visit <a href="https://example.com">Example</a>.</p>
<h2>Image</h2>
<p><img src="pic.jpg" alt="..."></p>
</html>With structure:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>My Mini Site</title>
</head>
<body>
<h1>My Mini Site</h1>
<p>Hi, I'm Student Name. This site will become my simple portfolio.</p>
<h2>Education</h2>
<p>University of Somewhere — B.A. (2025)</p>
<h2>Projects</h2>
<p>Project One: a short description goes here.</p>
<h2>Contact</h2>
<p>Email me at <a href="mailto:student@example.edu">student@example.edu</a>.</p>
<p><img src="https://picsum.photos/300/180" alt="A random placeholder image"></p>
</body>
</html><header> — title + navigation<nav> — menu of links<main> — main content<section> — thematic grouping<footer> — closing infoid and href="#..."html Filestinkys.html.<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>The Stinky Cheesemonger</title>
</head>
<body>
<h1>The Stinky Cheesemonger</h1>
<p>Welcome to The Stinky Cheesemonger — your neighborhood shop for gloriously pungent cheeses.</p>
<h2>Cheeses</h2>
<p>Try our favorites: Époisses, Limburger, Blue Stilton.</p>
<h2>Shop Info</h2>
<p>123 Rind Lane, Fromage City, Idaho</p>
<h2>Contact</h2>
<p>Email us at <a href="mailto:hello@stinkys.cheese">hello@stinkys.cheese</a></p>
<p><img src="https://picsum.photos/320/200" alt="A plate of assorted cheeses"></p>
</body>
</html><header>Purpose: Introduces the page (or a big section). Commonly holds the site name/logo and navigation.
How it Works: You can have a top-level <header> for the page.
- You can also have headers inside sections, but this is advanced – we’ll stick to one for now.
<header><nav> with linksPurpose: A container for site links (menus, table of contents, etc).
How it Works:
<header>.<nav> with links<main>Purpose: Contains the primary page content.
How it Works:
One per page. Improves accessibility.
Wrap your page’s primary content in a <main>...</main> element.
<main><body>
...
<main>
<p>Welcome to The Stinky Cheesemonger — your neighborhood shop for gloriously pungent cheeses.</p>
<h2>Cheeses</h2>
<p>Try our favorites: Époisses, Limburger, Blue Stilton.</p>
<h2>Shop Info</h2>
<p>123 Rind Lane, Fromage City, Idaho</p>
<h2>Contact</h2>
<p>Email us at <a href="mailto:hello@stinkys.cheese">hello@stinkys.cheese</a></p>
<p><img src="https://picsum.photos/320/200" alt="A plate of assorted cheeses"></p>
</main>
</body><section>Purpose: Groups related content with a heading.
How it Works:
Each section begins with an <h2>.
Give each an id.
<section>s and ids<body>
...
<main>
<section id="about">
<h2>About</h2>
<p>Welcome to The Stinky Cheesemonger — your neighborhood shop for gloriously pungent cheeses.</p>
<p><img src="https://picsum.photos/320/200" alt="A plate of assorted cheeses"></p>
</section>
<section id="cheeses">
<h2>Cheeses</h2>
<p>Try our favorites:</p>
<ul>
<li>Époisses — washed-rind, famously aromatic</li>
<li>Limburger — creamy, assertive, legendary funk</li>
<li>Blue Stilton — crumbly, sharp, deeply savory</li>
</ul>
</section>
<section id="shop">
<h2>Shop Info</h2>
<p>123 Rind Lane, Fromage City, Idaho</p>
<p>Open Tue–Sat, 11am–6pm</p>
</section>
<section id="contact">
<h2>Contact</h2>
<p>Email us at <a href="mailto:hello@stinkys.cheese">hello@stinkys.cheese</a></p>
</section>
</main>
</body><nav> links don’t seem to be working…stinkys_html file<p> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </p><footer>Purpose:
Ends the page. Great for © YEAR, contact info, or “Back to top.”
You can add an anchor that takes the user back to the top, which goes right after <body>.
<footer></main> but before </body>, you can add your<footer>...</footer> element<body>, wrap title in a <header>. <nav>
<a href="#about">About</a>
<a href="#education">Education</a>
<a href="#projects">Projects</a>
<a href="#contact">Contact</a>
</nav><main>.<section>s.<footer>. Be sure to add a page anchor at the top.