Skip to main content

HTML Cheat Sheet: The Most Comprehensive Guide to Common HTML Tags

This comprehensive HTML cheat sheet covers the essential HTML elements, attributes, and tags. Perfect for web developers and beginners to quickly reference and improve their HTML skills.

Essential HTML Elements

Document Structure

<html>
<head>
<title>Page Title</title>
</head>
<body>
<!-- Page content goes here -->
</body>
</html>

Headings

<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>

Paragraphs

<p>This is a paragraph.</p>

Line Breaks

<br/>

Lists

Unordered List

<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>

Ordered List

<ol>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ol>

Essential HTML Attributes

Class

<element class="class-name">

ID

<element id="id-name">

Style

<element style="property:value;">
<a href="url">Link text</a>

Essential HTML Tags

Image

<img src="image-source" alt="image description">

Table

<table>
<tr>
<th>Header 1</th>
<th>Header 2</th>
</tr>
<tr>
<td>Row 1, Column 1</td>
<td>Row 1, Column 2</td>
</tr>
<tr>
<td>Row 2, Column 1</td>
<td>Row 2, Column 2</td>
</tr>
</table>

Form

<form>
<input type="text">
<input type="submit">
</form>

Button

<button>Button</button>

Text Input

<input type="text">

Checkbox

<input type="checkbox">

Radio Button

<input type="radio">

Select Dropdown

<select>
<option>Option 1</option>
<option>Option 2</option>
<option>Option 3</option>
</select>

Textarea

<textarea rows="5" cols="30">Enter your text here...</textarea>

Div

<div>Content goes here...</div>

Span

<span>Content goes here...</span>

Anchor

<a href="url">Link text</a>
<a href="url">
<img src="image-source" alt="image description">
</a>

Abbreviation

<abbr title="Abbreviation">Abbr</abbr>

Code

<code>Code goes here...</code>

Keyboard Input

<kbd>Keyboard input</kbd>

Sample Output

<samp>Sample output</samp>

Variable

<var>Variable</var>

Bold

<strong>Bold text</strong>

Italic

<em>Italic text</em>

Underline

<u>Underlined text</u>

Strikethrough

<s>Strikethrough text</s>

Definition

<dfn>Definition</dfn>

Definition Term

<dt>Definition term</dt>

Definition Description

<dd>Definition description</dd>

Small

<small>Small text</small>

Mark

<mark>Marked text</mark>

Inserted

<ins>Inserted text</ins>

Deleted

<del>Deleted text</del>

Superscript

<sup>Superscript text</sup>

Subscript

<sub>Subscript text</sub>

Preformatted

<pre>Preformatted text</pre>

Blockquote

<blockquote>Blockquote text</blockquote>

Address

<address>Address</address>

Time

<time datetime="2022-12-31">31st December 2022</time>