HTML Cheat Sheet
HTML cheat sheet. You can print it for daily use.
HTML Basic Document
<!DOCTYPE html>
<html>
<head>
<title>Document title</title>
</head>
<body>
Visible content...
</body>
</html>
Basic Tags
<h1>The biggest heading</h1>
<h2> . . . </h2>
<h3> . . . </h3>
<h4> . . . </h4>
<h5> . . . </h5>
<h6>The minimal heading</h6>
<p>This is a paragraph</p>
<br> (line break)
<hr> (horizontal line)
<!-- this is a comment -->
Formatting
<b>Bold text</b>
<code>Computer code</code>
<em>Emphasize text</em>
<i>Italic text</i>
<kbd>Keyboard input</kbd>
<pre>Preformatted text</pre>
<small>smaller text</small>
<strong>Important text</strong>
<abbr> (abbreviation)
<address> (contact information)
<bdo> (text direction)
<blockquote> (a part quoted from another source)
<cite> (the name of the job)
<del> (deleted text)
<ins> (inserted text)
<sub> (subscript text)
<sup> (superscript text)
Links
Normal link: <a href="http://www.example.com/">link text</a>
Image link: <a href="http://www.example.com/"><img src="URL" alt="replace text"></a>
Email link: <a href="mailto:supports@example.com">send e-mail</a>
Bookmark:
<a id="tips">Tips section</a>
<a href="#tips">skip to tips section</a>
Images
<img loading="lazy" src="URL" alt="Alternative text" height="42" width="42">
Styles / Sections
<style type="text/css">
h1 {color:red;}
p {color:blue;}
</style>
<div>Block-level elements in the document</div>
<span>Inline elements in the document</span>
Unordered List
<ul>
<li>Project</li>
<li>Project</li>
</ul>
Ordered List
<ol>
<li>First item</li>
<li>The second item</li>
</ol>
Definition list
<dl>
<dt>Project 1</dt>
<dd>Describe item 1</dd>
<dt>Project 2</dt>
<dd>Describe item 2</dd>
</dl>
Tables
<table border="1">
<tr>
<th>Table title</th>
<th>Table title</th>
</tr>
<tr>
<td>Table data</td>
<td>Table data</td>
</tr>
</table>
Iframe
<iframe src="demo_iframe.htm"></iframe>
Forms
<form action="demo_form.php" method="post/get">
<input type="text" name="email" size="40" maxlength="50">
<input type="password">
<input type="checkbox" checked="checked">
<input type="radio" checked="checked">
<input type="submit" value="Send">
<input type="reset">
<input type="hidden">
<select>
<option>Apple</option>
<option selected="selected">Banana</option>
<option>cherry</option>
</select>
<textarea name="comment" rows="60" cols="20"></textarea>
</form>
Entities
< is equivalent to <
> is equivalent to>
© Same as ©