Page skeleton
01Every HTML file starts with this shape. head holds page info the browser uses; body holds what people see.
<!DOCTYPE html> <html> <head> <title>My Page</title> </head> <body> <!-- visible content goes here --> </body> </html>
Headings & text
02Headings show the page's outline — use them in order, not for making text big.
<h1>Page title</h1> <h2>Section title</h2> <p>A paragraph of text.</p> <strong>bold</strong> <em>italic</em>
Lists
03Unordered for no particular order, ordered when sequence matters.
<ul> <li>First item</li> <li>Second item</li> </ul> <ol> <li>Step one</li> </ol>
Links
04Link text should describe the destination — never "click here."
<a href="page2.html"> About us </a> <a href="https://example.com"> External site </a>
Navigating between pages
05A relative path is directions from the file that contains the link — not from your project as a whole.
<!-- from pages/about.html --> <a href="../index.html">Home</a <a href="contact.html">Contact</a <a href="about.html" aria-current="page">About</a
../ goes up one folder. Mark the current page with aria-current="page" plus a visible style — not one or the other.
Images
06alt is required — describe what the image shows, not just its filename.
<img src="cat.jpg" alt="Orange tabby cat">
Grouping content
07div is a generic container for CSS & layout. Give it a class to style it.
<div class="card"> <h2>Title</h2> <p>Text</p> </div>
Semantic layout
08Same visual result as a div, but these names carry meaning — for assistive tech, search engines, and you.
<header>...</header> <nav>...</nav> <main>...</main> <section>...</section> <footer>...</footer>
One main per page. section needs its own heading. Use div only when nothing more specific fits.
Attributes
09Extra info inside the opening tag. class can repeat on many elements; id is unique to one.
<p class="warning">... <div id="header">...
Comments
10Notes for humans — the browser ignores them entirely.
<!-- TODO: add the nav bar --> <p>Visible text</p>
Habits that keep pages working
11- Every opening tag needs a matching closing tag:
<p>…</p>. - Indent nested elements so the structure is visible at a glance.
- Make one change, then check the preview — don't stack up untested edits.
</li> pushes every item after it out of place.<p><div></p></div> — tags must close in reverse order.src=cat.jpg breaks — attribute values need "quotes".