HTML5 Cheat Sheet
Core HTML5 elements grouped by purpose โ quick reference for printing or PDF.
๐ Document Structure
Defines the overall HTML document, metadata, page title, styles, and scripts.
<!DOCTYPE html>
<html lang=”en”>
<head>
<meta charset=”UTF-8″>
<title>My Page</title>
<link rel=”stylesheet” href=”style.css”>
</head>
<body>
Content hereโฆ
</body>
</html>
๐ Layout & Page Sections
Semantic blocks that structure a page into meaningful sections and layout areas.
<header>
<h1>My Website</h1>
<nav>
<a href=”#”>Home</a>
<a href=”#”>Contact</a>
</nav>
</header>
<main>
<article>
<h2>Blog Post</h2>
<p>Post content…</p>
</article>
</main>
<footer>ยฉ 2025 My Website</footer>
โ๏ธ Text & Content
Basic building blocks for paragraphs, lists, quotations, and labelled figures.
<section>
<h2>Ingredients</h2>
<ul>
<li>Flour</li>
<li>Sugar</li>
<li>Butter</li>
</ul>
<figure>
<img src=”cake.jpg” alt=”Chocolate cake”>
<figcaption>Finished chocolate cake.</figcaption>
</figure>
</section>
๐ค Inline Text & Formatting
Inline elements that style or annotate text without breaking the flow.
<p>
Visit <a href=”https://example.com”>our site</a> for
<strong>important</strong> updates released on
<time datetime=”2025-01-01″>Jan 1, 2025</time>.
</p>
<p>Formula: H<sub>2</sub>O, E = mc<sup>2</sup></p>
๐ง Media & Embedded Content
Display images, audio, video, vector graphics, and other embedded content.
<picture>
<source srcset=”photo-large.jpg” media=”(min-width: 800px)”>
<img src=”photo-small.jpg” alt=”Landscape”>
</picture>
<video controls width=”320″>
<source src=”movie.mp4″ type=”video/mp4″>
Your browser does not support the video tag.
</video>
๐ฎ Forms & User Input
Collect data from users through text fields, checkboxes, selects, and more.
<form action=”/submit” method=”post”>
<fieldset>
<legend>Contact</legend>
<label for=”name”>Name:</label>
<input id=”name” name=”name” type=”text” required>
<label for=”msg”>Message:</label>
<textarea id=”msg” name=”message”></textarea>
<button type=”submit”>Send</button>
</fieldset>
</form>
โ๏ธ Interactive & Scripting
Elements that support interactivity, modals, collapsible sections, and web components.
<details>
<summary>Show advanced options</summary>
<p>Extra settings go here…</p>
</details>
<dialog open>
<p>This is a dialog box.</p>
<button>OK</button>
</dialog>
Tip: Print this page or export as PDF from your browser for a handy HTML5 reference sheet.