Cheatsheets HTML Cheatsheet Use this HTML cheatsheet to choose semantic tags, structure headings and sections, write accessible links, images, lists, tables and forms, then copy clean markup examples into your page.
Quick reference Document structure Page root <!doctype html>
Language <html lang="en">
Metadata <meta name="description" content="...">
Viewport <meta name="viewport" content="width=device-width, initial-scale=1">
Semantic elements Header <header>
Navigation <nav aria-label="Main">
Main content <main>
Footer <footer>
Forms Label <label for="email">Email</label>
Input <input id="email" type="email" required>
Textarea <textarea name="message"></textarea>
Button <button type="submit">Send</button>
<h1>Page heading</h1>
<h2>Section heading</h2>
<p>Paragraph text gives the heading useful context.</p><img src="preview.png" alt="Dashboard preview">
<a href="/guide">Read the guide</a>img {
max-width: 100%;
border-radius: 14px;
}
a {
color: #2563eb;
text-decoration: underline;
}<ul>
<li>Plan content</li>
<li>Write markup</li>
<li>Check semantics</li>
</ul>Live preview
Plan content Write markup Check semantics <table>
<thead>
<tr><th>Tag</th><th>Use</th></tr>
</thead>
<tbody>
<tr><td>th</td><td>Header cell</td></tr>
<tr><td>td</td><td>Data cell</td></tr>
</tbody>
</table>table {
width: 100%;
border-collapse: collapse;
}
th,
td {
border: 1px solid #dbe3ec;
padding: 10px;
}<label for="email">Email</label>
<input id="email" type="email" placeholder="you@example.com">
<button type="submit">Subscribe</button>label {
display: block;
font-weight: 700;
}
input,
button {
min-height: 42px;
}<header>Header</header>
<nav aria-label="Main">Navigation</nav>
<main>Main content</main>
<aside>Related</aside>
<footer>Footer</footer>When to use Use HTML to describe structure and meaning before styling. Use semantic landmarks for page regions users navigate repeatedly. Use tables only for real tabular data. Quick tips Write link text that makes sense out of context. Pair every visible input with a label. Use one main element for the primary page content. Common mistakes Using divs for every section when semantic tags would help. Leaving image alt text empty when the image communicates content. Using links for actions that should be buttons. Best practices Choose elements by meaning first and appearance second. Keep forms keyboard friendly and easy to scan. Validate generated markup before copying it into production. Examples <!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Page title</title>
</head>
<body>
<main>Content</main>
</body>
</html>Common mistakes and tips Use one main element per page for the primary content. Every form input should have a visible or accessible label. Use buttons for actions and links for navigation. HTML FAQ What is included in the HTML cheatsheet? HTML Cheatsheet includes quick reference sections, practical examples, common mistakes, tips and links to related DevKitYard tools.
Is the HTML cheatsheet interactive? Yes. This cheatsheet includes visual examples with copyable code and lightweight controls where interaction helps explain the pattern.
When should I use this HTML reference? Use it when you need to recall syntax, compare common patterns or avoid mistakes without opening a long tutorial.
What should I use after reading this cheatsheet? Use related DevKitYard tools such as HTML Formatter, Meta Tag Generator, HTML Table Builder when you need to format, validate, generate or inspect real output.