HTML
This HTML cheat sheet lists the common HTML and HTML5 tags in readable layout.
Getting Started
hello.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HTML5 Boilerplate</title>
</head>
<body>
<h1>Hello world, hello QuickRef.ME!</h1>
</body>
</html>Or try it out in the jsfiddle
Comment
<!-- this is a comment -->
<!--
Or you can comment out a
large number of lines.
-->Paragraph
HTML link
href
The URL that the hyperlink points to
rel
Relationship of the linked URL
target
Link target location:
_self, _blank, _top, _parent
See: The <a> Attributes
Image Tag
src
Required, Image location (URL | Path)
alt
Describe of the image
width
Width of the image
height
Height of the image
loading
How the browser should load
Text Formatting Tags
Headings
You should only have one h1 on your page
Section Divisions
<div></div>
Division or Section of Page Content
<span></span>
Section of text within other content
<p></p>
Paragraph of Text
<br>
Line Break
<hr>
Basic Horizontal Line
These are the tags used to divide your page up into sections
Inline Frame
↓ Preview
JavaScript in HTML
External JavaScript
CSS in HTML
External stylesheet
HTML5 Tags
Document
Header Navigation
HTML5 Tags
Content that’s independent
Secondary content
Embeds a sound, or an audio stream
The Bidirectional Isolate element
Draw graphics via JavaScript
Machine readable content
A set of pre-defined options
Additional information
A dialog box or sub-window
Embeds external application
A caption or legend for a figure
A figure illustrated
Footer or least important
Masthead or important information
The main content of the document
Text highlighted
A scalar value within a known range
A section of navigation links
The result of a calculation
A container for multiple image sources
The completion progress of a task
Provides fall-back parenthesis
Defines the pronunciation of character
Represents a ruby annotation
A group in a series of related content
Resources for the media elements
A summary for the <details> element
Defines the fragments of HTML
A time or date
Text tracks for the media elements
Embeds video
A line break opportunity
HTML5 Video
↓ Preview
HTML5 Audio
↓ Preview
HTML5 Ruby
↓ Preview
汉hàn字zì
HTML5 kdi
↓ Preview
User hrefs: 60 points
User jdoe: 80 points
User إيان: 90 points
HTML5 progress
HTML5 mark
I Love QuickRef.ME
HTML Tables
Table Example
HTML Table Tags
Defines a table
Defines a header cell in a table
Defines a row in a table
Defines a cell in a table
Defines a table caption
Defines a group of columns
Defines a column within a table
Groups the header content
Groups the body content
Groups the footer content
<td> Attributes
colspan
Number of columns a cell should span
headers
One or more header cells a cell is related to
rowspan
Number of rows a cell should span
See: td#Attributes
<th> Attributes
colspan
Number of columns a cell should span
headers
One or more header cells a cell is related to
rowspan
Number of rows a cell should span
abbr
Description of the cell's content
The header element relates to
See: th#Attributes
HTML Lists
Unordered list
See: The Unordered List element
Ordered list
Definition list
See: The Description List element
HTML Forms
Form tags
↓ Preview
Email: Password: Remember me
The HTML <form> element is used to collect and send information to an external source.
Form Attribute
name
Name of form for scripting
action
URL of form script
method
HTTP method, POST / GET (default)
enctype
Media type, See enctype
onsubmit
Runs when the form was submit
onreset
Runs when the form was reset
Label tags
for in a label references an input's id attribute
Input tags
↓ Preview
Username:
See: HTML input Tags
Textarea tags
↓ Preview
Textarea is a multiple-line text input control
Radio Buttons
↓ Preview
Male Female
Radio buttons are used to let the user select exactly one
Checkboxes
↓ Preview
Soccer Baseball
Checkboxes allows the user to select one or more
Select tags
↓ Preview
City: Sydney Melbourne Cromwell
A select box is a dropdown list of options
Fieldset tags
↓ Preview
Your favorite monster Kraken Sasquatch
Datalist tags(HTML5)
↓ Preview
Choose a browser:
Submit and Reset Buttons
↓ Preview
Name:
Submit the data to server; Reset to default values
HTML input Tags
Input Attributes
The input tag is an empty element, identifying the particular type of field information to obtain from a user.
type="…"
The type of data that is being input
value="…"
Default value
name="…"
Used to describe this data in the HTTP request
id="…"
Unique identifier that other HTML elements
readonly
Stops the user from modifying
disabled
Stops any interaction
checked
The radio or checkbox select or not
autocomplete="off"
Disable auto completion
autocapitalize="none"
Disable auto capitalization
maxlength="…"
Maximum number of characters
minlength="…"
Minimum number of characters
min="…"
Minimum numerical value on range & number
max="…"
Maximum numerical value on range & number
step="…"
How the number will increment in range & number
autofocus
Be focused
spellcheck
Perform spell checking
Also see: Attributes for the <input> element
Input types
type="checkbox"
type="radio"
type="file"
type="hidden"
type="text"
type="password"
type="image"
type="reset"
type="button"
Button
type="submit"
New Input Types in HTML5
type="color"
type="date"
type="time"
type="month"
type="datetime-local"
type="week"
type="email"
type="tel"
type="url"
type="number"
type="search"
type="range"
Input CSS selectors
input:focus
When its keyboard focused
See: Input pseudo classes
HTML meta Tags
Meta tags
The meta tag describes meta data within an HTML document. It explains additional material about the HTML.
Open Graph
Used by Facebook, Instagram, Pinterest, LinkedIn, etc.
Twitter Cards
See: Twitter Card Documentation
Geotagging
See: Geotagging
Last updated