HTML Cheat Sheet
HTML Cheat Sheet
HTML cheatsheet
This HTML quick reference cheat sheet lists the common HTML and HTML5 tags in readable layout.
# Getting Started
hello.html Comment
<h1> This is Heading 1 </h1> <div></div> Division or Section of Page Content <iframe title="New York"
<h2> This is Heading 2 </h2> width="342"
<span></span> Section of text within other content
<h3> This is Heading 3 </h3> height="306"
<h4> This is Heading 4 </h4> id="gmap_canvas"
<p></p> Paragraph of Text
<h5> This is Heading 5 </h5> src="https://maps.google.com/maps?
<h6> This is Heading 6 </h6> <br> Line Break q=2880%20Broadway,%20New%20York&t=&z=13&ie
=UTF8&iwloc=&output=embed"
<hr> Basic Horizontal Line scrolling="no">
</iframe>
These are the tags used to divide your page up into
You should only have one h1 on your page sections ↓ Preview
# HTML5 Tags
Document Header Navigation HTML5 Tags
<header> <nav>
aside Secondary content
<nav>...</nav> <ul>
</header> <li><a href="#">Edit Page</a></li> audio Embeds a sound, or an audio stream
<main> <li><a href="#">Twitter</a></li>
<h1>QuickRef.ME</h1> <li><a href="#">Facebook</a></li> bdi The Bidirectional Isolate element
</main> </ul>
<footer> </nav> canvas Draw graphics via JavaScript
<p>©2023 QuickRef.ME</p> </header>
</footer> data Machine readable content
</body>
datalist A set of pre-defined options
# HTML Tables
Table Example HTML Table Tags <td> Attributes
<table> <table> Defines a table colspan Number of columns a cell should span
<thead>
<th> Defines a header cell in a table headers One or more header cells a cell is related to
<tr>
<td>name</td> <tr> Defines a row in a table rowspan Number of rows a cell should span
<td>age</td>
</tr> <td> Defines a cell in a table See: td#Attributes
</thead>
<tbody> <caption> Defines a table caption
<tr> <th> Attributes
<td>Roberta</td> <colgroup> Defines a group of columns
colspan Number of columns a cell should span
<td>39</td>
<col> Defines a column within a table
</tr>
headers One or more header cells a cell is related to
<tr>
<thead> Groups the header content
<td>Oliver</td> rowspan Number of rows a cell should span
<td>25</td> <tbody> Groups the body content
</tr> abbr Description of the cell's content
</tbody> <tfoot> Groups the footer content
</table> scope The header element relates to
See: th#Attributes
# HTML Lists
Unordered list Ordered list Definition list
See: The Unordered List element See: The Ordered List element See: The Description List element
# HTML Forms
Form tags Form Attribute Label tags
<form method="POST" action="api/login"> name Name of form for scripting <!-- Nested label -->
<label for="mail">Email: </label> <label>Click me
action URL of form script
<input type="email" id="mail" name="mail" <input type="text" id="user" name="name"/>
<br/> </label>
method HTTP method, POST / GET (default)
<label for="pw">Password: </label>
<input type="password" id="pw" name="pw"> enctype Media type, See enctype <!-- 'for' attribute -->
<br/>
<label for="user">Click me</label>
<input type="submit" value="Login"> onsubmit Runs when the form was submit
<input id="user" type="text" name="name"/>
<br/>
<input type="checkbox" id="ck" name="ck"> onreset Runs when the form was reset
<label for="ck">Remember me</label> for in a label references an input's id attribute
</form>
Password:
↓ Preview ↓ Preview
Login
Remember me Username:
<input type="radio" name="gender" id="m"> <input type="checkbox" name="s" id="soc"> <label for="city">City:</label>
<label for="m">Male</label> <label for="soc">Soccer</label> <select name="city" id="city">
<input type="radio" name="gender" id="f"> <input type="checkbox" name="s" id="bas"> <option value="1">Sydney</option>
<label for="f">Female</label> <label for="bas">Baseball</label> <option value="2">Melbourne</option>
<option value="3">Cromwell</option>
↓ Preview ↓ Preview </select>
City: Sydney
Radio buttons are used to let the user select exactly one Checkboxes allows the user to select one or more A select box is a dropdown list of options
The input tag is an empty element, identifying the particular type of field information to type="checkbox"
obtain from a user.
type="radio"
step="…" How the number will increment in range & number type="url"
Also see: Attributes for the <input> element See: Input pseudo classes
The meta tag describes meta data within an HTML document. It explains additional <meta property="og:type" content="website">
material about the HTML. <meta property="og:locale" content="en_CA">
<meta property="og:title" content="HTML cheatsheet">
<meta charset="utf-8"> <meta property="og:url" content="https://quickref.me/html">
<meta property="og:image" content="https://xxx.com/image.jpg">
<meta property="og:site_name" content="Name of your website">
<!-- title -->
<meta property="og:description" content="Description of this page">
<title>···</title>
<meta property="og:title" content="···">
<meta name="twitter:title" content="···">
Used by Facebook, Instagram, Pinterest, LinkedIn, etc.
# Also see
HTML 4.01 Specification (w3.org)
中文版 #Notes
jQuery Cheatsheet Laravel Cheatsheet PyTorch Cheatsheet Taskset Cheatsheet
Quick Reference Quick Reference Quick Reference Quick Reference