Quick reference for essential HTML tags. Click any code block to copy.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Page Title</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<!-- Content goes here -->
<script src="script.js"></script>
</body>
</html>
<h1>Main Title (only one per page)</h1>
<h2>Section Heading</h2>
<h3>Subsection</h3>
<h4>Smaller heading</h4>
<h5>Even smaller</h5>
<h6>Smallest</h6>
<p>Paragraph of text</p>
<strong>Important (bold)</strong>
<em>Emphasis (italic)</em>
<br> <!-- Line break -->
<blockquote>
A quoted passage
</blockquote>
<code>Inline code</code>
<!-- External link -->
<a href="https://example.com">Link text</a>
<!-- Internal link -->
<a href="about.html">About page</a>
<!-- Same page anchor -->
<a href="#section-id">Jump to section</a>
<!-- Email link -->
<a href="mailto:email@example.com">Email me</a>
<!-- Open in new tab -->
<a href="https://example.com" target="_blank" rel="noopener">External link</a>
<img src="photo.jpg" alt="Description of image">
<!-- With specific size -->
<img src="photo.jpg" alt="Description" width="800" height="600">
<!-- Lazy loading -->
<img src="photo.jpg" alt="Description" loading="lazy">
<!-- Unordered list (bullets) -->
<ul>
<li>Item one</li>
<li>Item two</li>
<li>Item three</li>
</ul>
<!-- Ordered list (numbers) -->
<ol>
<li>First item</li>
<li>Second item</li>
<li>Third item</li>
</ol>
<header>
<nav>
<a href="/">Home</a>
<a href="/about">About</a>
</nav>
</header>
<main>
<article>
<h2>Article Title</h2>
<p>Article content...</p>
</article>
<section>
<h2>Section Title</h2>
<p>Section content...</p>
</section>
</main>
<aside>
<!-- Sidebar content -->
</aside>
<footer>
<p>© 2025 Your Name</p>
</footer>
<!-- Block-level container -->
<div class="container">
<!-- Content -->
</div>
<!-- Inline container -->
<span class="highlight">Highlighted text</span>
<form action="/submit" method="post">
<!-- Text input -->
<label for="name">Name:</label>
<input type="text" id="name" name="name" required>
<!-- Email input -->
<label for="email">Email:</label>
<input type="email" id="email" name="email" required>
<!-- Textarea -->
<label for="message">Message:</label>
<textarea id="message" name="message" rows="5"></textarea>
<!-- Submit button -->
<button type="submit">Submit</button>
</form>
<table>
<thead>
<tr>
<th>Header 1</th>
<th>Header 2</th>
</tr>
</thead>
<tbody>
<tr>
<td>Data 1</td>
<td>Data 2</td>
</tr>
</tbody>
</table>
<!-- Audio -->
<audio controls>
<source src="audio.mp3" type="audio/mpeg">
</audio>
<!-- Video -->
<video controls width="640" height="360">
<source src="video.mp4" type="video/mp4">
</video>
<!-- YouTube embed -->
<iframe src="https://www.youtube.com/embed/VIDEO_ID"
width="560" height="315"
frameborder="0" allowfullscreen>
</iframe>
< <!-- < -->
> <!-- > -->
& <!-- & -->
" <!-- " -->
© <!-- © -->
<!-- Non-breaking space -->
<!-- ID (unique on page) -->
<div id="unique-id"></div>
<!-- Class (reusable) -->
<div class="class-name"></div>
<div class="class-one class-two"></div>
<!-- Data attributes (custom data) -->
<div data-id="123" data-category="example"></div>
<!-- Alt text for images (required!) -->
<img src="photo.jpg" alt="Description">
<!-- ARIA label -->
<button aria-label="Close menu">×</button>
<!-- Hidden from screen readers -->
<span aria-hidden="true">🎨</span>
Bad
<p>Text (no closing tag)<p><strong>Text</p></strong><img src=photo.jpg>Good
<p>Text</p><p><strong>Text</strong></p><img src="photo.jpg">
<nav>, <article>, <section>)<h1> per pagelang attribute on <html><button> for buttons, not <div onclick><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Page description for SEO">
<title>Page Title</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<header>
<nav>
<a href="/">Home</a>
<a href="/about">About</a>
</nav>
</header>
<main>
<h1>Page Title</h1>
<p>Content goes here...</p>
</main>
<footer>
<p>© 2025 Your Name</p>
</footer>
<script src="script.js"></script>
</body>
</html>