HTML 5
HTML 5
Tag Description
Defines a comment
Formatting
<!--...-->
Tag Description
<template> Defines a container for content that should be hidden when the page
loads
<u> Defines some text that is unarticulated and styled differently from
normal text
Frames
Tag Description
Images
Tag Description
Audio / Video
Tag Description
<audio> Defines sound content
Links
Tag Description
Lists
Tag Description
Tables
Tag Description
Meta Info
Tag Description
Programming
Tag Description
Attribute Belongs to
accept <input>
accept-charset <form>
action <form>
align Not supported in HTML 5.
alt <area>, <img>, <input>
async <script>
autocomplete <form>, <input>
autofocus <button>, <input>, <select>, <textarea>
autoplay <audio>, <video>
checked <input>
cols <textarea>
colspan <td>, <th>
content <meta>
contenteditable Global Attributes
controls <audio>, <video>
coords <area>
data <object>
datetime <del>, <ins>, <time>
default <track>
defer <script>
dir Global Attributes
dirname <input>, <textarea>
download <a>, <area>
enctype <form>
for <label>, <output>
form <button>, <fieldset>, <input>, <label>, <meter>, <object>, <output>, <select>, <textarea>
formaction <button>, <input>
headers <td>, <th>
height <canvas>, <embed>, <iframe>, <img>, <input>, <object>, <video>
high <meter>
href <a>, <area>, <base>, <link>
hreflang <a>, <area>, <link>
http-equiv <meta>
id Global Attributes
ismap <img>
kind <track>
label <track>, <option>, <optgroup>
list <input>
loop <audio>, <video>
low <meter>
max <input>, <meter>, <progress>
maxlength <input>, <textarea>
media <a>, <area>, <link>, <source>, <style>
method <form>
min <input>, <meter>
multiple <input>, <select>
muted <video>, <audio>
name <button>, <fieldset>, <form>, <iframe>, <input>, <map>, <meta>, <object>, <output>, <param>,
<textarea>
novalidate <form>
onabort <audio>, <embed>, <img>, <object>, <video>
onafterprint <body>
onbeforeprint <body>
onbeforeunload <body>
oncanplay <audio>, <embed>, <object>, <video>
oncanplaythroug <audio>, <video>
h
ondurationchang <audio>, <video>
e
onemptied <audio>, <video>
onended <audio>, <video>
onerror <audio>, <body>, <embed>, <img>, <object>, <script>, <style>, <video>
onhashchange <body>
onload <body>, <iframe>, <img>, <input>, <link>, <script>, <style>
onloadeddata <audio>, <video>
onloadedmetada <audio>, <video>
ta
onloadstart <audio>, <video>
onoffline <body>
ononline <body>
onpagehide <body>
onpageshow <body>
onpaste All visible elements.
onpause <audio>, <video>
onplay <audio>, <video>
onplaying <audio>, <video>
onpopstate <body>
onprogress <audio>, <video>
onratechange <audio>, <video>
onreset <form>
onresize <body>
onscroll All visible elements.
onsearch <input>
onseeked <audio>, <video>
onseeking <audio>, <video>
onstalled <audio>, <video>
onstorage <body>
onsubmit <form>
onsuspend <audio>, <video>
ontimeupdate <audio>, <video>
ontoggle <details>
onunload <body>
onvolumechange <audio>, <video>
onwaiting <audio>, <video>
onwheel All visible elements.
open <details>
optimum <meter>
pattern <input>
placeholder <input>, <textarea>
poster <video>
preload <audio>, <video>
readonly <input>, <textarea>
rel <a>, <area>, <form>, <link>
required <input>, <select>, <textarea>
reversed <ol>
rows <textarea>
rowspan <td>, <th>
sandbox <iframe>
scope <th>
selected <option>
shape <area>
size <input>, <select>
sizes <img>, <link>, <source>
span <col>, <colgroup>
src <audio>, <embed>, <iframe>, <img>, <input>, <script>, <source>, <track>, <video>
srcdoc <iframe>
srclang <track>
srcset <img>, <source>
start <ol>
step <input>
target <a>, <area>, <base>, <form>
type <a>, <button>, <embed>, <input>, <link>, <menu>, <object>, <script>, <source>, <style>
usemap <img>, <object>
value <button>, <input>, <li>, <option>, <meter>, <progress>, <param>
width <canvas>, <embed>, <iframe>, <img>, <input>, <object>, <video>
wrap <textarea>
Attribute Description
Below are the global event attributes that can be added to HTML elements to
define event actions.
onunload scrip Fires once a page has unloaded (or the browser
t window has been closed)
Form Events
Events triggered by actions inside a HTML form (applies to almost all HTML
elements, but is most used in form elements):
onblur scrip Fires the moment that the element loses focus
t
onchange scrip Fires the moment when the value of the element
t is changed
onfocus scrip Fires the moment when the element gets focus
t
Keyboard Events
Attribute Value Description
Mouse Events
Attribute Value Description
Drag Events
Attribute Value Description
Clipboard Events
Attribute Value Description
oncopy scrip Fires when the user copies the content of an element
t
oncut scrip Fires when the user cuts the content of an element
t
onpaste scrip Fires when the user pastes some content in an element
t
Media Events
Events triggered by medias like videos, images and audio (applies to all HTML
elements, but is most common in media elements, like <audio>, <embed>,
<img>, <object>, and <video>).
Misc Events
Attribute Value Description
ontoggle scrip Fires when the user opens or closes the <details>
t element
Color Names Supported by All Browsers
All modern browsers support the following 140 color names (click on a color
name, or a hex value, to view the color as the background-color along with
different text colors):
AliceBlue
#F0F8FF
Color Mixer
Color Picker
AntiqueWhite
#FAEBD7
Color Mixer
Color Picker
Aqua
#00FFFF
Color Mixer
Color Picker
Aquamarine
#7FFFD4
Color Mixer
Color Picker
Azure
#F0FFFF
Color Mixer
Color Picker
Beige
#F5F5DC
Color Mixer
Color Picker
Bisque
#FFE4C4
Color Mixer
Color Picker
Black
#000000
Color Mixer
Color Picker
BlanchedAlmond
#FFEBCD
Color Mixer
Color Picker
Blue
#0000FF
Color Mixer
Color Picker
BlueViolet
#8A2BE2
Color Mixer
Color Picker
Brown
#A52A2A
Color Mixer
Color Picker
BurlyWood
#DEB887
Color Mixer
Color Picker
CadetBlue
#5F9EA0
Color Mixer
Color Picker
Chartreuse
#7FFF00
Color Mixer
Color Picker
Chocolate
#D2691E
Color Mixer
Color Picker
Coral
#FF7F50
Color Mixer
Color Picker
CornflowerBlue
#6495ED
Color Mixer
Color Picker
Cornsilk
#FFF8DC
Color Mixer
Color Picker
Crimson
#DC143C
Color Mixer
Color Picker
Cyan
#00FFFF
Color Mixer
Color Picker
DarkBlue
#00008B
Color Mixer
Color Picker
DarkCyan
#008B8B
Color Mixer
Color Picker
DarkGoldenRod
#B8860B
Color Mixer
Color Picker
DarkGray
#A9A9A9
Color Mixer
Color Picker
DarkGrey
#A9A9A9
Color Mixer
Color Picker
DarkGreen
#006400
Color Mixer
Color Picker
DarkKhaki
#BDB76B
Color Mixer
Color Picker
DarkMagenta
#8B008B
Color Mixer
Color Picker
DarkOliveGreen
#556B2F
Color Mixer
Color Picker
DarkOrange
#FF8C00
Color Mixer
Color Picker
DarkOrchid
#9932CC
Color Mixer
Color Picker
DarkRed
#8B0000
Color Mixer
Color Picker
DarkSalmon
#E9967A
Color Mixer
Color Picker
DarkSeaGreen
#8FBC8F
Color Mixer
Color Picker
DarkSlateBlue
#483D8B
Color Mixer
Color Picker
DarkSlateGray
#2F4F4F
Color Mixer
Color Picker
DarkSlateGrey
#2F4F4F
Color Mixer
Color Picker
DarkTurquoise
#00CED1
Color Mixer
Color Picker
DarkViolet
#9400D3
Color Mixer
Color Picker
DeepPink
#FF1493
Color Mixer
Color Picker
DeepSkyBlue
#00BFFF
Color Mixer
Color Picker
DimGray
#696969
Color Mixer
Color Picker
DimGrey
#696969
Color Mixer
Color Picker
DodgerBlue
#1E90FF
Color Mixer
Color Picker
FireBrick
#B22222
Color Mixer
Color Picker
FloralWhite
#FFFAF0
Color Mixer
Color Picker
ForestGreen
#228B22
Color Mixer
Color Picker
Fuchsia
#FF00FF
Color Mixer
Color Picker
Gainsboro
#DCDCDC
Color Mixer
Color Picker
GhostWhite
#F8F8FF
Color Mixer
Color Picker
Gold
#FFD700
Color Mixer
Color Picker
GoldenRod
#DAA520
Color Mixer
Color Picker
Gray
#808080
Color Mixer
Color Picker
Grey
#808080
Color Mixer
Color Picker
Green
#008000
Color Mixer
Color Picker
GreenYellow
#ADFF2F
Color Mixer
Color Picker
HoneyDew
#F0FFF0
Color Mixer
Color Picker
HotPink
#FF69B4
Color Mixer
Color Picker
IndianRed
#CD5C5C
Color Mixer
Color Picker
Indigo
#4B0082
Color Mixer
Color Picker
Ivory
#FFFFF0
Color Mixer
Color Picker
Khaki
#F0E68C
Color Mixer
Color Picker
Lavender
#E6E6FA
Color Mixer
Color Picker
LavenderBlush
#FFF0F5
Color Mixer
Color Picker
LawnGreen
#7CFC00
Color Mixer
Color Picker
LemonChiffon
#FFFACD
Color Mixer
Color Picker
LightBlue
#ADD8E6
Color Mixer
Color Picker
LightCoral
#F08080
Color Mixer
Color Picker
LightCyan
#E0FFFF
Color Mixer
Color Picker
LightGoldenRodYellow
#FAFAD2
Color Mixer
Color Picker
LightGray
#D3D3D3
Color Mixer
Color Picker
LightGrey
#D3D3D3
Color Mixer
Color Picker
LightGreen
#90EE90
Color Mixer
Color Picker
LightPink
#FFB6C1
Color Mixer
Color Picker
LightSalmon
#FFA07A
Color Mixer
Color Picker
LightSeaGreen
#20B2AA
Color Mixer
Color Picker
LightSkyBlue
#87CEFA
Color Mixer
Color Picker
LightSlateGray
#778899
Color Mixer
Color Picker
LightSlateGrey
#778899
Color Mixer
Color Picker
LightSteelBlue
#B0C4DE
Color Mixer
Color Picker
LightYellow
#FFFFE0
Color Mixer
Color Picker
Lime
#00FF00
Color Mixer
Color Picker
LimeGreen
#32CD32
Color Mixer
Color Picker
Linen
#FAF0E6
Color Mixer
Color Picker
Magenta
#FF00FF
Color Mixer
Color Picker
Maroon
#800000
Color Mixer
Color Picker
MediumAquaMarine
#66CDAA
Color Mixer
Color Picker
MediumBlue
#0000CD
Color Mixer
Color Picker
MediumOrchid
#BA55D3
Color Mixer
Color Picker
MediumPurple
#9370DB
Color Mixer
Color Picker
MediumSeaGreen
#3CB371
Color Mixer
Color Picker
MediumSlateBlue
#7B68EE
Color Mixer
Color Picker
MediumSpringGreen
#00FA9A
Color Mixer
Color Picker
MediumTurquoise
#48D1CC
Color Mixer
Color Picker
MediumVioletRed
#C71585
Color Mixer
Color Picker
MidnightBlue
#191970
Color Mixer
Color Picker
MintCream
#F5FFFA
Color Mixer
Color Picker
MistyRose
#FFE4E1
Color Mixer
Color Picker
Moccasin
#FFE4B5
Color Mixer
Color Picker
NavajoWhite
#FFDEAD
Color Mixer
Color Picker
Navy
#000080
Color Mixer
Color Picker
OldLace
#FDF5E6
Color Mixer
Color Picker
Olive
#808000
Color Mixer
Color Picker
OliveDrab
#6B8E23
Color Mixer
Color Picker
Orange
#FFA500
Color Mixer
Color Picker
OrangeRed
#FF4500
Color Mixer
Color Picker
Orchid
#DA70D6
Color Mixer
Color Picker
PaleGoldenRod
#EEE8AA
Color Mixer
Color Picker
PaleGreen
#98FB98
Color Mixer
Color Picker
PaleTurquoise
#AFEEEE
Color Mixer
Color Picker
PaleVioletRed
#DB7093
Color Mixer
Color Picker
PapayaWhip
#FFEFD5
Color Mixer
Color Picker
PeachPuff
#FFDAB9
Color Mixer
Color Picker
Peru
#CD853F
Color Mixer
Color Picker
Pink
#FFC0CB
Color Mixer
Color Picker
Plum
#DDA0DD
Color Mixer
Color Picker
PowderBlue
#B0E0E6
Color Mixer
Color Picker
Purple
#800080
Color Mixer
Color Picker
RebeccaPurple
#663399
Color Mixer
Color Picker
Red
#FF0000
Color Mixer
Color Picker
RosyBrown
#BC8F8F
Color Mixer
Color Picker
RoyalBlue
#4169E1
Color Mixer
Color Picker
SaddleBrown
#8B4513
Color Mixer
Color Picker
Salmon
#FA8072
Color Mixer
Color Picker
SandyBrown
#F4A460
Color Mixer
Color Picker
SeaGreen
#2E8B57
Color Mixer
Color Picker
SeaShell
#FFF5EE
Color Mixer
Color Picker
Sienna
#A0522D
Color Mixer
Color Picker
Silver
#C0C0C0
Color Mixer
Color Picker
SkyBlue
#87CEEB
Color Mixer
Color Picker
SlateBlue
#6A5ACD
Color Mixer
Color Picker
SlateGray
#708090
Color Mixer
Color Picker
SlateGrey
#708090
Color Mixer
Color Picker
Snow
#FFFAFA
Color Mixer
Color Picker
SpringGreen
#00FF7F
Color Mixer
Color Picker
SteelBlue
#4682B4
Color Mixer
Color Picker
Tan
#D2B48C
Color Mixer
Color Picker
Teal
#008080
Color Mixer
Color Picker
Thistle
#D8BFD8
Color Mixer
Color Picker
Tomato
#FF6347
Color Mixer
Color Picker
Turquoise
#40E0D0
Color Mixer
Color Picker
Violet
#EE82EE
Color Mixer
Color Picker
Wheat
#F5DEB3
Color Mixer
Color Picker
White
#FFFFFF
Color Mixer
Color Picker
WhiteSmoke
#F5F5F5
Color Mixer
Color Picker
Yellow
#FFFF00
Color Mixer
Color Picker
YellowGreen
#9ACD32
Color Mixer
Color
Method Description
Line Styles
Property Description
lineCap Sets or returns the style of the end caps for a line
lineJoin Sets or returns the type of corner created, when two lines
meet
Paths
Method Description
Transformations
Method Description
font Sets or returns the current font properties for text content
textBaseline Sets or returns the current text baseline used when drawing
text
Method Description
Image Drawing
Method Description
Pixel Manipulation
Propert Description
y
width Returns the width of an ImageData object
Method Description
Compositing
Property Description
Other
Method Description
save() Saves the state of the current context
createEvent(
)
getContext()
toDataURL()
Property Description
Method Description
Line Styles
Property Description
lineCap Sets or returns the style of the end caps for a line
lineJoin Sets or returns the type of corner created, when two lines
meet
Method Description
Paths
Method Description
Transformations
Method Description
Text
Property Description
font Sets or returns the current font properties for text content
textBaseline Sets or returns the current text baseline used when drawing
text
Method Description
Image Drawing
Method Description
Pixel Manipulation
Propert Description
y
Method Description
Compositing
Property Description
Other
Method Description
save() Saves the state of the current context
createEvent(
)
getContext()
toDataURL()
Method Description
Property Description
autoplay Sets or returns whether the audio/video should start playing as soon as it is
loaded
controls Sets or returns whether the audio/video should display controls (like
play/pause etc.)
currentTime Sets or returns the current playback position in the audio/video (in
seconds)
loop Sets or returns whether the audio/video should start over again when
finished
mediaGroup Sets or returns the group the audio/video belongs to (used to link multiple
audio/video elements)
preload Sets or returns whether the audio/video should be loaded when the page
loads
Event Description
canplay Fires when the browser can start playing the audio/video
canplaythrough Fires when the browser can play through the audio/video without stopping for
buffering
loadeddata Fires when the browser has loaded the current frame of the audio/video
loadedmetadat Fires when the browser has loaded meta data for the audio/video
a
loadstart Fires when the browser starts looking for the audio/video
play Fires when the audio/video has been started or is no longer paused
playing Fires when the audio/video is playing after having been paused or stopped for
buffering
seeked Fires when the user is finished moving/skipping to a new position in the
audio/video
seeking Fires when the user starts moving/skipping to a new position in the
audio/video
stalled Fires when the browser is trying to get media data, but data is not available
suspend Fires when the browser is intentionally not getting media data
waiting Fires when the video stops because it needs to buffer the next frame