Tag | Description |
---|---|
<!–…–> | Defines a comment |
<!DOCTYPE> | Defines the document type |
<a> | Defines a hyperlink |
<abbr> | Defines an abbreviation or an acronym |
<acronym> | Not supported in HTML5. Use <abbr> instead. Defines an acronym |
<address> | Defines contact information for the author/owner of a document |
<applet> | Not supported in HTML5. Use <embed> or <object> instead. Defines an embedded applet |
<area> | Defines an area inside an image map |
<article> | Defines an article |
<aside> | Defines content aside from the page content |
<audio> | Defines embedded sound content |
<b> | Defines bold text |
<base> | Specifies the base URL/target for all relative URLs in a document |
<basefont> | Not supported in HTML5. Use CSS instead. Specifies a default color, size, and font for all text in a document |
<bdi> | Isolates a part of text that might be formatted in a different direction from other text outside it |
<bdo> | Overrides the current text direction |
<big> | Not supported in HTML5. Use CSS instead. Defines big text |
<blockquote> | Defines a section that is quoted from another source |
<body> | Defines the document’s body |
<br> | Defines a single line break |
<button> | Defines a clickable button |
<canvas> | Used to draw graphics, on the fly, via scripting (usually JavaScript) |
<caption> | Defines a table caption |
<center> | Not supported in HTML5. Use CSS instead. Defines centered text |
<cite> | Defines the title of a work |
<code> | Defines a piece of computer code |
<col> | Specifies column properties for each column within a <colgroup> element |
<colgroup> | Specifies a group of one or more columns in a table for formatting |
<data> | Adds a machine-readable translation of a given content |
<datalist> | Specifies a list of pre-defined options for input controls |
<dd> | Defines a description/value of a term in a description list |
<del> | Defines text that has been deleted from a document |
<details> | Defines additional details that the user can view or hide |
<dfn> | Specifies a term that is going to be defined within the content |
<dialog> | Defines a dialog box or window |
<dir> | Not supported in HTML5. Use <ul> instead. Defines a directory list |
<div> | Defines a section in a document |
<dl> | Defines a description list |
<dt> | Defines a term/name in a description list |
<em> | Defines emphasized text |
<embed> | Defines a container for an external application |
<fieldset> | Groups related elements in a form |
<figcaption> | Defines a caption for a <figure> element |
<figure> | Specifies self-contained content |
<font> | Not supported in HTML5. Use CSS instead. Defines font, color, and size for text |
<footer> | Defines a footer for a document or section |
<form> | Defines an HTML form for user input |
<frame> | Not supported in HTML5. Defines a window (a frame) in a frameset |
<frameset> | Not supported in HTML5. Defines a set of frames |
<h1> to <h6> | Defines HTML headings |
<head> | Contains metadata/information for the document |
<header> | Defines a header for a document or section |
<hr> | Defines a thematic change in the content |
<html> | Defines the root of an HTML document |
<i> | Defines a part of text in an alternate voice or mood |
<iframe> | Defines an inline frame |
<img> | Defines an image |
<input> | Defines an input control |
<ins> | Defines a text that has been inserted into a document |
<kbd> | Defines keyboard input |
<label> | Defines a label for an <input> element |
<legend> | Defines a caption for a <fieldset> element |
<li> | Defines a list item |
<link> | Defines the relationship between a document and an external resource (most used to link to style sheets) |
<main> | Specifies the main content of a document |
<map> | Defines an image map |
<mark> | Defines marked/highlighted text |
<meta> | Defines metadata about an HTML document |
<meter> | Defines a scalar measurement within a known range (a gauge) |
<nav> | Defines navigation links |
<noframes> | Not supported in HTML5. Defines an alternate content for users that do not support frames |
<noscript> | Defines an alternate content for users that do not support client-side scripts |
<object> | Defines a container for an external application |
<ol> | Defines an ordered list |
<optgroup> | Defines a group of related options in a drop-down list |
<option> | Defines an option in a drop-down list |
<output> | Defines the result of a calculation |
<p> | Defines a paragraph |
<param> | Defines a parameter for an object |
<picture> | Defines a container for multiple image resources |
<pre> | Defines preformatted text |
<progress> | Represents the progress of a task |
<q> | Defines a short quotation |
<rp> | Defines what to show in browsers that do not support ruby annotations |
<rt> | Defines an explanation/pronunciation of characters (for East Asian typography) |
<ruby> | Defines a ruby annotation (for East Asian typography) |
<s> | Defines text that is no longer correct |
<samp> | Defines sample output from a computer program |
<script> | Defines a client-side script |
<section> | Defines a section in a document |
<select> | Defines a drop-down list |
<small> | Defines smaller text |
<source> | Defines multiple media resources for media elements (<video> and <audio>) |
<span> | Defines a section in a document |
<strike> | Not supported in HTML5. Use <del> or <s> instead. Defines strikethrough text |
<strong> | Defines important text |
<style> | Defines style information for a document |
<sub> | Defines subscripted text |
<summary> | Defines a visible heading for a <details> element |
<sup> | Defines superscripted text |
<svg> | Defines a container for SVG graphics |
<table> | Defines a table |
<tbody> | Groups the body content in a table |
<td> | Defines a cell in a table |
<template> | Defines a container for content that should be hidden when the page loads |
<textarea> | Defines a multiline input control (text area) |
<tfoot> | Groups the footer content in a table |
<th> | Defines a header cell in a table |
<thead> | Groups the header content in a table |
<time> | Defines a specific time (or datetime) |
<title> | Defines a title for the document |
<tr> | Defines a row in a table |
<track> | Defines text tracks for media elements (<video> and <audio>) |
<tt> | Not supported in HTML5. Use CSS instead. Defines teletype text |
<u> | Defines some text that is unarticulated and styled differently from normal text |
<ul> | Defines an unordered list |
<var> | Defines a variable |
<video> | Defines embedded video content |
<wbr> | Defines a possible line-break |
Basic HTML
Tag | Description |
---|---|
<!DOCTYPE> | Defines the document type |
<html> | Defines an HTML document |
<head> | Contains metadata/information for the document |
<title> | Defines a title for the document |
<body> | Defines the document’s body |
<h1> to <h6> | Defines HTML headings |
<p> | Defines a paragraph |
<br> | Inserts a single line break |
<hr> | Defines a thematic change in the content |
<!–…–> | Defines a comment |
Formatting
Tag | Description |
---|---|
<acronym> | Not supported in HTML5. Use <abbr> instead. Defines an acronym |
<abbr> | Defines an abbreviation or an acronym |
<address> | Defines contact information for the author/owner of a document/article |
<b> | Defines bold text |
<bdi> | Isolates a part of text that might be formatted in a different direction from other text outside it |
<bdo> | Overrides the current text direction |
<big> | Not supported in HTML5. Use CSS instead. Defines big text |
<blockquote> | Defines a section that is quoted from another source |
<center> | Not supported in HTML5. Use CSS instead. Defines centered text |
<cite> | Defines the title of a work |
<code> | Defines a piece of computer code |
<del> | Defines text that has been deleted from a document |
<dfn> | Specifies a term that is going to be defined within the content |
<em> | Defines emphasized text |
<font> | Not supported in HTML5. Use CSS instead. Defines font, color, and size for text |
<i> | Defines a part of text in an alternate voice or mood |
<ins> | Defines a text that has been inserted into a document |
<kbd> | Defines keyboard input |
<mark> | Defines marked/highlighted text |
<meter> | Defines a scalar measurement within a known range (a gauge) |
<pre> | Defines preformatted text |
<progress> | Represents the progress of a task |
<q> | Defines a short quotation |
<rp> | Defines what to show in browsers that do not support ruby annotations |
<rt> | Defines an explanation/pronunciation of characters (for East Asian typography) |
<ruby> | Defines a ruby annotation (for East Asian typography) |
<s> | Defines text that is no longer correct |
<samp> | Defines sample output from a computer program |
<small> | Defines smaller text |
<strike> | Not supported in HTML5. Use <del> or <s> instead. Defines strikethrough text |
<strong> | Defines important text |
<sub> | Defines subscripted text |
<sup> | Defines superscripted text |
<template> | Defines a container for content that should be hidden when the page loads |
<time> | Defines a specific time (or datetime) |
<tt> | Not supported in HTML5. Use CSS instead. Defines teletype text |
<u> | Defines some text that is unarticulated and styled differently from normal text |
<var> | Defines a variable |
<wbr> | Defines a possible line-break |
Forms and Input
Tag | Description |
---|---|
<form> | Defines an HTML form for user input |
<input> | Defines an input control |
<textarea> | Defines a multiline input control (text area) |
<button> | Defines a clickable button |
<select> | Defines a drop-down list |
<optgroup> | Defines a group of related options in a drop-down list |
<option> | Defines an option in a drop-down list |
<label> | Defines a label for an <input> element |
<fieldset> | Groups related elements in a form |
<legend> | Defines a caption for a <fieldset> element |
<datalist> | Specifies a list of pre-defined options for input controls |
<output> | Defines the result of a calculation |
Frames
Tag | Description |
---|---|
<frame> | Not supported in HTML5. Defines a window (a frame) in a frameset |
<frameset> | Not supported in HTML5. Defines a set of frames |
<noframes> | Not supported in HTML5. Defines an alternate content for users that do not support frames |
<iframe> | Defines an inline frame |
Images
Tag | Description |
---|---|
<img> | Defines an image |
<map> | Defines a client-side image map |
<area> | Defines an area inside an image map |
<canvas> | Used to draw graphics, on the fly, via scripting (usually JavaScript) |
<figcaption> | Defines a caption for a <figure> element |
<figure> | Specifies self-contained content |
<picture> | Defines a container for multiple image resources |
<svg> | Defines a container for SVG graphics |
Audio / Video
Tag | Description |
---|---|
<audio> | Defines sound content |
<source> | Defines multiple media resources for media elements (<video>, <audio> and <picture>) |
<track> | Defines text tracks for media elements (<video> and <audio>) |
<video> | Defines a video or movie |
Links
Tag | Description |
---|---|
<a> | Defines a hyperlink |
<link> | Defines the relationship between a document and an external resource (most used to link to style sheets) |
<nav> | Defines navigation links |
Lists
Tag | Description |
---|---|
<ul> | Defines an unordered list |
<ol> | Defines an ordered list |
<li> | Defines a list item |
<dir> | Not supported in HTML5. Use <ul> instead. Defines a directory list |
<dl> | Defines a description list |
<dt> | Defines a term/name in a description list |
<dd> | Defines a description of a term/name in a description list |
Tables
Tag | Description |
---|---|
<table> | Defines a table |
<caption> | Defines a table caption |
<th> | Defines a header cell in a table |
<tr> | Defines a row in a table |
<td> | Defines a cell in a table |
<thead> | Groups the header content in a table |
<tbody> | Groups the body content in a table |
<tfoot> | Groups the footer content in a table |
<col> | Specifies column properties for each column within a <colgroup> element |
<colgroup> | Specifies a group of one or more columns in a table for formatting |
Styles and Semantics
Tag | Description |
---|---|
<style> | Defines style information for a document |
<div> | Defines a section in a document |
<span> | Defines a section in a document |
<header> | Defines a header for a document or section |
<footer> | Defines a footer for a document or section |
<main> | Specifies the main content of a document |
<section> | Defines a section in a document |
<article> | Defines an article |
<aside> | Defines content aside from the page content |
<details> | Defines additional details that the user can view or hide |
<dialog> | Defines a dialog box or window |
<summary> | Defines a visible heading for a <details> element |
<data> | Adds a machine-readable translation of a given content |
Meta Info
Tag | Description |
---|---|
<head> | Defines information about the document |
<meta> | Defines metadata about an HTML document |
<base> | Specifies the base URL/target for all relative URLs in a document |
<basefont> | Not supported in HTML5. Use CSS instead. Specifies a default color, size, and font for all text in a document |
Programming
Tag | Description |
---|---|
<script> | Defines a client-side script |
<noscript> | Defines an alternate content for users that do not support client-side scripts |
<applet> | Not supported in HTML5. Use <embed> or <object> instead. Defines an embedded applet |
<embed> | Defines a container for an external (non-HTML) application |
<object> | Defines an embedded object |
<param> | Defines a parameter for an object |
HTML Reference With Browser Support
The table below lists all HTML elements and their attributes, along with browser support:
<a> | Yes | Yes | Yes | Yes | Yes |
download | 14.0 | 18.0 | 20.0 | 10.1 | 15.0 |
href | Yes | Yes | Yes | Yes | Yes |
hreflang | Yes | Yes | Yes | Yes | Yes |
media | Yes | Yes | Yes | Yes | Yes |
ping | Yes | No | Yes | No | Yes |
referrerpolicy | 51.0 | No | 50.0 | 11.1 | 38.0 |
rel | Yes | Yes | Yes | Yes | Yes |
target | Yes | Yes | Yes | Yes | Yes |
type | Yes | Yes | Yes | Yes | Yes |
<abbr> | Yes | Yes | Yes | Yes | Yes |
<address> | Yes | Yes | Yes | Yes | Yes |
<area> | Yes | Yes | Yes | Yes | Yes |
alt | Yes | Yes | Yes | Yes | Yes |
coords | Yes | Yes | Yes | Yes | Yes |
download | Yes | Yes | Yes | Yes | Yes |
href | Yes | Yes | Yes | Yes | Yes |
hreflang | Yes | Yes | Yes | Yes | Yes |
media | Yes | Yes | Yes | Yes | Yes |
referrerpolicy | 51.0 | No | 50.0 | 11.1 | 38.0 |
rel | Yes | Yes | Yes | Yes | Yes |
shape | Yes | Yes | Yes | Yes | Yes |
target | Yes | Yes | Yes | Yes | Yes |
type | Yes | Yes | Yes | Yes | Yes |
<article> | 6.0 | 9.0 | 4.0 | 5.0 | 11.1 |
<aside> | 6.0 | 9.0 | 4.0 | 5.0 | 11.1 |
<audio> | 4.0 | 9.0 | 3.5 | 4.0 | 11.5 |
autoplay | 4.0 | 9.0 | 3.5 | 4.0 | 11.5 |
controls | 4.0 | 9.0 | 3.5 | 4.0 | 11.5 |
loop | 4.0 | 9.0 | 3.5 | 4.0 | 11.5 |
muted | 4.0 | 10.0 | 11.0 | 7.1 | 11.5 |
preload | 4.0 | 9.0 | 4.0 | 4.0 | 11.5 |
src | 4.0 | 9.0 | 3.5 | 4.0 | 11.5 |
<b> | Yes | Yes | Yes | Yes | Yes |
<bdi> | 16.0 | 79.0 | 10.0 | No | 15.0 |
<blockquote> | Yes | Yes | Yes | Yes | Yes |
cite | Yes | Yes | Yes | Yes | Yes |
<body> | Yes | Yes | Yes | Yes | Yes |
<br> | Yes | Yes | Yes | Yes | Yes |
<button> | Yes | Yes | Yes | Yes | Yes |
autofocus | 5.0 | 10.0 | 4.0 | 5.0 | 9.6 |
disabled | Yes | Yes | Yes | Yes | Yes |
form | 10.0 | 16.0 | 4.0 | 5.1 | 9.5 |
formaction | 9.0 | 10.0 | 4.0 | 5.1 | 15.0 |
formenctype | 9.0 | 10.0 | 4.0 | 5.1 | 11.5 |
formmethod | 9.0 | 10.0 | 4.0 | 5.1 | 15.0 |
formnovalidate | 6.0 | 11.0 | 4.0 | Yes | Yes |
formtarget | 9.0 | 10.0 | 4.0 | 5.1 | 10.6 |
name | Yes | Yes | Yes | Yes | Yes |
type | Yes | Yes | Yes | Yes | Yes |
value | Yes | Yes | Yes | Yes | Yes |
<caption> | Yes | Yes | Yes | Yes | Yes |
<cite> | Yes | Yes | Yes | Yes | Yes |
<code> | Yes | Yes | Yes | Yes | Yes |
<colgroup> | Yes | Yes | Yes | Yes | Yes |
span | Yes | Yes | Yes | Yes | Yes |
<data> | 62.0 | 13.0 | 22.0 | No | 49.0 |
value | 62.0 | 13.0 | 22.0 | No | 49.0 |
<datalist> | 20.0 | 10.0 | 4.0 | 12.1 | 9.5 |
<dd> | Yes | Yes | Yes | Yes | Yes |
<dfn> | Yes | Yes | Yes | Yes | Yes |
* Not supported by default, but can be enabled in about:config (set dom.dialog_element.enabled to true).
<div> | Yes | Yes | Yes | Yes | Yes |
<dl> | Yes | Yes | Yes | Yes | Yes |
<dt> | Yes | Yes | Yes | Yes | Yes |
<em> | Yes | Yes | Yes | Yes | Yes |
<embed> | Yes | Yes | Yes | Yes | Yes |
height | Yes | Yes | Yes | Yes | Yes |
src | Yes | Yes | Yes | Yes | Yes |
type | Yes | Yes | Yes | Yes | Yes |
width | Yes | Yes | Yes | Yes | Yes |
<fieldset> | Yes | Yes | Yes | Yes | Yes |
disabled | Yes | Yes | Yes | 6.0 | Yes |
form | Yes | Yes | Yes | Yes | Yes |
name | Yes | 11.0 | Yes | Yes | Yes |
<figcaption> | 8.0 | 9.0 | 4.0 | 5.1 | 11.0 |
<figure> | 8.0 | 9.0 | 4.0 | 5.1 | 11.0 |
<footer> | 5.0 | 9.0 | 4.0 | 5.0 | 11.1 |
<form> | Yes | Yes | Yes | Yes | Yes |
accept-charset | Yes | Yes | Yes | Yes | Yes |
action | Yes | Yes | Yes | Yes | Yes |
autocomplete | Yes | Yes | 4.0 | 5.2 | 15.0 |
enctype | Yes | Yes | Yes | Yes | Yes |
method | Yes | Yes | Yes | Yes | Yes |
name | Yes | Yes | Yes | Yes | Yes |
novalidate | Yes | 10.0 | 4.0 | 10.1 | 15.0 |
rel | Yes | Yes | Yes | Yes | Yes |
target | Yes | Yes | Yes | Yes | Yes |
<h1> – <h6> | Yes | Yes | Yes | Yes | Yes |
<head> | Yes | Yes | Yes | Yes | Yes |
<header> | 5.0 | 9.0 | 4.0 | 5.0 | 11.1 |
<hr> | Yes | Yes | Yes | Yes | Yes |
<i> | Yes | Yes | Yes | Yes | Yes |
<iframe> | Yes | Yes | Yes | Yes | Yes |
allow | 60.0 | 79.0 | 74.0 | 11.1 | 47.0 |
allowfullscreen | 27.0 | 11.0 -ms- | 18.0 | 7.0 | Yes |
allowpaymentrequest | No | No | No | No | No |
height | Yes | Yes | Yes | Yes | Yes |
name | Yes | Yes | Yes | Yes | Yes |
referrerpolicy | 51.0 | 79.0 | 50.0 | 11.1 | 38.0 |
sandbox | 4.0 | 10.0 | 17.0 | 5.0 | 15.0 |
src | Yes | Yes | Yes | Yes | Yes |
srcdoc | 20.0 | 79.0 | 25.0 | 6.0 | 15.0 |
width | Yes | Yes | Yes | Yes | Yes |
<img> | Yes | Yes | Yes | Yes | Yes |
alt | Yes | Yes | Yes | Yes | Yes |
crossorigin | Yes | Yes | Yes | Yes | Yes |
height | Yes | Yes | Yes | Yes | Yes |
ismap | Yes | Yes | Yes | Yes | Yes |
loading | 77.0 | 79.0 | 75.0 | No | 64.0 |
longdesc | Yes | Yes | Yes | Yes | Yes |
referrerpolicy | 51.0 | 79.0 | 50.0 | 11.1 | 38.0 |
sizes | Yes | Yes | Yes | Yes | Yes |
src | Yes | Yes | Yes | Yes | Yes |
srcset | 34.0 | ? | 38.0 | 8.0 | 21.0 |
usemap | Yes | Yes | Yes | Yes | Yes |
width | Yes | Yes | Yes | Yes | Yes |
<input> | Yes | Yes | Yes | Yes | Yes |
accept | 26.0 | 10.0 | 37.0 | 11.1 | 15.0 |
alt | Yes | Yes | Yes | Yes | Yes |
autocomplete | 17.0 | 6.0 | 2.0 | 5.1 | 10.0 |
autofocus | 5.0 | 11.0 | 4.0 | 5.0 | 9.6 |
checked | Yes | Yes | Yes | Yes | Yes |
dirname | Yes | 79.0 | No | Yes | Yes |
disabled | Yes | Yes | Yes | Yes | Yes |
form | Yes | Yes | Yes | 5.1 | 10.6 |
formaction | Yes | 10.0 | Yes | 5.1 | 10.6 |
formenctype | Yes | 10.0 | Yes | 5.1 | 10.6 |
formmethod | Yes | 10.0 | Yes | 5.1 | 10.6 |
formnovalidate | Yes | 10.0 | Yes | 10.1 | 10.6 |
formtarget | Yes | 10.0 | Yes | 5.1 | 10.6 |
height | Yes | Yes | 16.0 | Yes | Yes |
list | 20.0 | 10.0 | 4.0 | No | 9.6 |
max | 5.0 | 10.0 | 16.0 | 5.1 | 10.6 |
maxlength | 4.0 | 10.0 | 4.0 | 5.1 | 15.0 |
min | 5.0 | 10.0 | 16.0 | 5.1 | 10.6 |
minlength | 40.0 | 17.0 | 51.0 | 10.1 | 27.0 |
multiple | 6.0 | 10.0 | 3.6 | 5.0 | 11.0 |
name | Yes | Yes | Yes | Yes | Yes |
pattern | 5.0 | 10.0 | 4.0 | 10.1 | 9.6 |
placeholder | 10.0 | 10.0 | 4.0 | 5.0 | 11.0 |
readonly | Yes | Yes | Yes | Yes | Yes |
required | 5.0 | 10.0 | 4.0 | 10.1 | 9.6 |
size | Yes | Yes | Yes | Yes | Yes |
src | Yes | Yes | Yes | Yes | Yes |
step | 6.0 | 10.0 | 16.0 | 5.0 | 10.6 |
type | Yes | Yes | Yes | Yes | Yes |
value | Yes | Yes | Yes | Yes | Yes |
width | Yes | Yes | 16.0 | Yes | Yes |
<kbd> | Yes | Yes | Yes | Yes | Yes |
<legend> | Yes | Yes | Yes | Yes | Yes |
<link> | Yes | Yes | Yes | Yes | Yes |
crossorigin | 25.0 | 79.0 | 18.0 | ? | 15.0 |
href | Yes | Yes | Yes | Yes | Yes |
hreflang | Yes | Yes | Yes | Yes | Yes |
media | Yes | Yes | Yes | Yes | Yes |
referrerpolicy | 51.0 | 79.0 | 50.0 | 11.1 | 38.0 |
rel | Yes | Yes | Yes | Yes | Yes |
sizes | No | No | No | No | No |
title | Yes | Yes | Yes | Yes | Yes |
type | Yes | Yes | Yes | Yes | Yes |
<main> | 26.0 | 12.0 | 21.0 | 7.0 | 16.0 |
<mark> | 6.0 | 9.0 | 4.0 | 5.0 | 11.1 |
<meta> | Yes | Yes | Yes | Yes | Yes |
charset | Yes | Yes | Yes | Yes | Yes |
content | Yes | Yes | Yes | Yes | Yes |
http_equiv | Yes | Yes | Yes | Yes | Yes |
name | Yes | Yes | Yes | Yes | Yes |
<meter> | 8.0 | 13.0 | 16.0 | 6.0 | 11.5 |
form | No | No | No | No | No |
high | 8.0 | 13.0 | 16.0 | 6.0 | 11.5 |
low | 8.0 | 13.0 | 16.0 | 6.0 | 11.5 |
max | 8.0 | 13.0 | 16.0 | 6.0 | 11.5 |
min | 8.0 | 13.0 | 16.0 | 6.0 | 11.5 |
optimum | 8.0 | 13.0 | 16.0 | 6.0 | 11.5 |
value | 8.0 | 13.0 | 16.0 | 6.0 | 11.5 |
<nav> | 5.0 | 9.0 | 4.0 | 5.0 | 11.1 |
<noscript> | Yes | Yes | Yes | Yes | Yes |
<object> | Yes | Yes | Yes | Yes | Yes |
data | Yes | Yes | Yes | Yes | Yes |
form | No | No | No | No | No |
height | Yes | Yes | Yes | Yes | Yes |
name | Yes | Yes | Yes | Yes | Yes |
type | Yes | Yes | Yes | Yes | Yes |
usemap | No | No | Yes | No | No |
width | Yes | Yes | Yes | Yes | Yes |
<optgroup> | Yes | Yes | Yes | Yes | Yes |
disabled | Yes | 8.0 | Yes | Yes | Yes |
label | Yes | Yes | Yes | Yes | Yes |
<option> | Yes | Yes | Yes | Yes | Yes |
disabled | Yes | 8.0 | Yes | Yes | Yes |
label | Yes | 8.0 | No | Yes | Yes |
selected | Yes | Yes | Yes | Yes | Yes |
value | Yes | Yes | Yes | Yes | Yes |
<p> | Yes | Yes | Yes | Yes | Yes |
<picture> | 38.0 | 13.0 | 38.0 | 9.1 | 25.0 |
<pre> | Yes | Yes | Yes | Yes | Yes |
<progress> | 8.0 | 10.0 | 16.0 | 6.0 | 11.0 |
max | 8.0 | 10.0 | 16.0 | 6.0 | 11.0 |
value | 8.0 | 10.0 | 16.0 | 6.0 | 11.0 |
<rp> | 5.0 | 5.5 | 38.0 | 5.0 | 15.0 |
<rt> | 5.0 | 5.5 | 38.0 | 5.0 | 15.0 |
<ruby> | 5.0 | 5.5 | 38.0 | 5.0 | 15.0 |
<s> | Yes | Yes | Yes | Yes | Yes |
<samp> | Yes | Yes | Yes | Yes | Yes |
<script> | Yes | Yes | Yes | Yes | Yes |
async | 8.0 | 10.0 | 3.6 | 5.1 | 15.0 |
charset | Yes | Yes | Yes | Yes | Yes |
crossorigin | 30.0 | 18.0 | 13.0 | 13.0 | 12.1 |
defer | 8.0 | 10.0 | 3.5 | 5.0 | 15.0 |
integrity | 45.0 | 17.0 | 43.0 | 13.0 | 66.0 |
referrerpolicy | 70.0 | 79.0 | 65.0 | Yes | No |
src | Yes | Yes | Yes | Yes | Yes |
type | Yes | Yes | Yes | Yes | Yes |
<section> | 5.0 | 9.0 | 4.0 | 5.0 | 11.5 |
<select> | Yes | Yes | Yes | Yes | Yes |
autofocus | Yes | 10.0 | No | Yes | Yes |
disabled | Yes | 9.0 | Yes | Yes | Yes |
form | Yes | Yes | Yes | Yes | Yes |
multiple | Yes | Yes | Yes | Yes | Yes |
name | Yes | Yes | Yes | Yes | Yes |
required | Yes | 10.0 | 4.0 | Yes | Yes |
size | Yes | Yes | Yes | Yes | Yes |
<slot> | 53.0 | 79.0 | 63.0 | 10.0 | 40.0 |
<small> | Yes | Yes | Yes | Yes | Yes |
<source> | 4.0 | 9.0 | 3.5 | 4.0 | 10.5 |
media | 38.0 | 9.0 | 15.0 | 9.1 | 25.0 |
sizes | 38.0 | 13.0 | 3.8 | 9.1 | 25.0 |
src | 4.0 | 9.0 | 3.5 | 4.0 | 10.5 |
srcset | 38.0 | 13.0 | 38.0 | 9.1 | 25.0 |
type | 4.0 | 9.0 | 3.5 | 4.0 | 10.5 |
<span> | Yes | Yes | Yes | Yes | Yes |
<strong> | Yes | Yes | Yes | Yes | Yes |
<sub> | Yes | Yes | Yes | Yes | Yes |
<summary> | 12.0 | 79.0 | 49.0 | 6.0 | 15.0 |
<sup> | Yes | Yes | Yes | Yes | Yes |
<svg> | 4.0 | 9.0 | 3.0 | 3.2 | 10.1 |
<table> | Yes | Yes | Yes | Yes | Yes |
<tbody> | Yes | Yes | Yes | Yes | Yes |
<template> | 26.0 | 13.0 | 22.0 | 8.0 | 15.0 |
<textarea> | Yes | Yes | Yes | Yes | Yes |
autocomplete | No | No | 59.0 | 13.0 | No |
autofocus | Yes | 10.0 | 4.0 | Yes | Yes |
cols | Yes | Yes | Yes | Yes | Yes |
dirname | Yes | 79.0 | No | Yes | Yes |
disabled | Yes | Yes | Yes | Yes | Yes |
form | Yes | 11.0 | Yes | Yes | Yes |
maxlength | Yes | 10.0 | 4.0 | Yes | Yes |
minlength | Yes | Yes | Yes | Yes | Yes |
name | Yes | Yes | Yes | Yes | Yes |
placeholder | Yes | 10.0 | 4.0 | 5.0 | 11.5 |
readonly | Yes | Yes | Yes | Yes | Yes |
required | Yes | 10.0 | 4.0 | Yes | Yes |
rows | Yes | Yes | Yes | Yes | Yes |
spellcheck | Yes | 11.0 | Yes | Yes | Yes |
wrap | Yes | Yes | Yes | Yes | Yes |
<tfoot> | Yes | Yes | Yes | Yes | Yes |
<th> | Yes | Yes | Yes | Yes | Yes |
abbr | Yes | Yes | Yes | Yes | Yes |
colspan | Yes | Yes | Yes | Yes | Yes |
headers | Yes | Yes | Yes | Yes | Yes |
rowspan | Yes | Yes | Yes | Yes | Yes |
scope | Yes | Yes | Yes | Yes | Yes |
<thead> | Yes | Yes | Yes | Yes | Yes |
<title> | Yes | Yes | Yes | Yes | Yes |
<tr> | Yes | Yes | Yes | Yes | Yes |
<track> | 23.0 | 10.0 | 31.0 | 6.0 | 12.1 |
default | 23.0 | 10.0 | 31.0 | 6.0 | 12.1 |
kind | 23.0 | 10.0 | 31.0 | 6.0 | 12.1 |
label | 23.0 | 10.0 | 31.0 | 6.0 | 12.1 |
src | 23.0 | 10.0 | 31.0 | 6.0 | 12.1 |
srclang | 23.0 | 10.0 | 31.0 | 6.0 | 12.1 |
<u> | Yes | Yes | Yes | Yes | Yes |
<ul> | Yes | Yes | Yes | Yes | Yes |
<var> | Yes | Yes | Yes | Yes | Yes |
<video> | 4.0 | 9.0 | 3.5 | 3.1 | 11.5 |
autoplay | 4.0 | 9.0 | 3.5 | 3.1 | 11.5 |
controls | 4.0 | 9.0 | 3.5 | 3.1 | 11.5 |
height | 4.0 | 9.0 | 3.5 | 3.1 | 11.5 |
loop | 4.0 | 9.0 | 11.0 | 3.1 | 11.5 |
muted | 30.0 | 10.0 | 11.0 | 5.0 | Yes |
poster | 4.0 | 9.0 | 3.6 | 3.1 | 10.5 |
preload | 4.0 | 9.0 | 4.0 | 3.1 | 10.5 |
src | 4.0 | 9.0 | 3.5 | 3.1 | 11.5 |
width | 4.0 | 9.0 | 3.5 | 3.1 | 11.5 |
<wbr> | Yes | Yes | Yes | Yes | Yes |
HTML Attribute Reference
The table below lists all HTML attributes and what elements they can be used within:
Attribute | Belongs to | Description |
---|---|---|
accept | <input> | Specifies the types of files that the server accepts (only for type=”file”) |
accept-charset | <form> | Specifies the character encodings that are to be used for the form submission |
accesskey | Global Attributes | Specifies a shortcut key to activate/focus an element |
action | <form> | Specifies where to send the form-data when a form is submitted |
align | Not supported in HTML 5. | Specifies the alignment according to surrounding elements. Use CSS instead |
alt | <area>, <img>, <input> | Specifies an alternate text when the original element fails to display |
async | <script> | Specifies that the script is executed asynchronously (only for external scripts) |
autocomplete | <form>, <input> | Specifies whether the <form> or the <input> element should have autocomplete enabled |
autofocus | <button>, <input>, <select>, <textarea> | Specifies that the element should automatically get focus when the page loads |
autoplay | <audio>, <video> | Specifies that the audio/video will start playing as soon as it is ready |
bgcolor | Not supported in HTML 5. | Specifies the background color of an element. Use CSS instead |
border | Not supported in HTML 5. | Specifies the width of the border of an element. Use CSS instead |
charset | <meta>, <script> | Specifies the character encoding |
checked | <input> | Specifies that an <input> element should be pre-selected when the page loads (for type=”checkbox” or type=”radio”) |
cite | <blockquote>, <del>, <ins>, <q> | Specifies a URL which explains the quote/deleted/inserted text |
class | Global Attributes | Specifies one or more classnames for an element (refers to a class in a style sheet) |
color | Not supported in HTML 5. | Specifies the text color of an element. Use CSS instead |
cols | <textarea> | Specifies the visible width of a text area |
colspan | <td>, <th> | Specifies the number of columns a table cell should span |
content | <meta> | Gives the value associated with the http-equiv or name attribute |
contenteditable | Global Attributes | Specifies whether the content of an element is editable or not |
controls | <audio>, <video> | Specifies that audio/video controls should be displayed (such as a play/pause button etc) |
coords | <area> | Specifies the coordinates of the area |
data | <object> | Specifies the URL of the resource to be used by the object |
data-* | Global Attributes | Used to store custom data private to the page or application |
datetime | <del>, <ins>, <time> | Specifies the date and time |
default | <track> | Specifies that the track is to be enabled if the user’s preferences do not indicate that another track would be more appropriate |
defer | <script> | Specifies that the script is executed when the page has finished parsing (only for external scripts) |
dir | Global Attributes | Specifies the text direction for the content in an element |
dirname | <input>, <textarea> | Specifies that the text direction will be submitted |
disabled | <button>, <fieldset>, <input>, <optgroup>, <option>, <select>, <textarea> | Specifies that the specified element/group of elements should be disabled |
download | <a>, <area> | Specifies that the target will be downloaded when a user clicks on the hyperlink |
draggable | Global Attributes | Specifies whether an element is draggable or not |
enctype | <form> | Specifies how the form-data should be encoded when submitting it to the server (only for method=”post”) |
for | <label>, <output> | Specifies which form element(s) a label/calculation is bound to |
form | <button>, <fieldset>, <input>, <label>, <meter>, <object>, <output>, <select>, <textarea> | Specifies the name of the form the element belongs to |
formaction | <button>, <input> | Specifies where to send the form-data when a form is submitted. Only for type=”submit” |
headers | <td>, <th> | Specifies one or more headers cells a cell is related to |
height | <canvas>, <embed>, <iframe>, <img>, <input>, <object>, <video> | Specifies the height of the element |
hidden | Global Attributes | Specifies that an element is not yet, or is no longer, relevant |
high | <meter> | Specifies the range that is considered to be a high value |
href | <a>, <area>, <base>, <link> | Specifies the URL of the page the link goes to |
hreflang | <a>, <area>, <link> | Specifies the language of the linked document |
http-equiv | <meta> | Provides an HTTP header for the information/value of the content attribute |
id | Global Attributes | Specifies a unique id for an element |
ismap | <img> | Specifies an image as a server-side image map |
kind | <track> | Specifies the kind of text track |
label | <track>, <option>, <optgroup> | Specifies the title of the text track |
lang | Global Attributes | Specifies the language of the element’s content |
list | <input> | Refers to a <datalist> element that contains pre-defined options for an <input> element |
loop | <audio>, <video> | Specifies that the audio/video will start over again, every time it is finished |
low | <meter> | Specifies the range that is considered to be a low value |
max | <input>, <meter>, <progress> | Specifies the maximum value |
maxlength | <input>, <textarea> | Specifies the maximum number of characters allowed in an element |
media | <a>, <area>, <link>, <source>, <style> | Specifies what media/device the linked document is optimized for |
method | <form> | Specifies the HTTP method to use when sending form-data |
min | <input>, <meter> | Specifies a minimum value |
multiple | <input>, <select> | Specifies that a user can enter more than one value |
muted | <video>, <audio> | Specifies that the audio output of the video should be muted |
name | <button>, <fieldset>, <form>, <iframe>, <input>, <map>, <meta>, <object>, <output>, <param>, <select>, <textarea> | Specifies the name of the element |
novalidate | <form> | Specifies that the form should not be validated when submitted |
onabort | <audio>, <embed>, <img>, <object>, <video> | Script to be run on abort |
onafterprint | <body> | Script to be run after the document is printed |
onbeforeprint | <body> | Script to be run before the document is printed |
onbeforeunload | <body> | Script to be run when the document is about to be unloaded |
onblur | All visible elements. | Script to be run when the element loses focus |
oncanplay | <audio>, <embed>, <object>, <video> | Script to be run when a file is ready to start playing (when it has buffered enough to begin) |
oncanplaythrough | <audio>, <video> | Script to be run when a file can be played all the way to the end without pausing for buffering |
onchange | All visible elements. | Script to be run when the value of the element is changed |
onclick | All visible elements. | Script to be run when the element is being clicked |
oncontextmenu | All visible elements. | Script to be run when a context menu is triggered |
oncopy | All visible elements. | Script to be run when the content of the element is being copied |
oncuechange | <track> | Script to be run when the cue changes in a <track> element |
oncut | All visible elements. | Script to be run when the content of the element is being cut |
ondblclick | All visible elements. | Script to be run when the element is being double-clicked |
ondrag | All visible elements. | Script to be run when the element is being dragged |
ondragend | All visible elements. | Script to be run at the end of a drag operation |
ondragenter | All visible elements. | Script to be run when an element has been dragged to a valid drop target |
ondragleave | All visible elements. | Script to be run when an element leaves a valid drop target |
ondragover | All visible elements. | Script to be run when an element is being dragged over a valid drop target |
ondragstart | All visible elements. | Script to be run at the start of a drag operation |
ondrop | All visible elements. | Script to be run when dragged element is being dropped |
ondurationchange | <audio>, <video> | Script to be run when the length of the media changes |
onemptied | <audio>, <video> | Script to be run when something bad happens and the file is suddenly unavailable (like unexpectedly disconnects) |
onended | <audio>, <video> | Script to be run when the media has reach the end (a useful event for messages like “thanks for listening”) |
onerror | <audio>, <body>, <embed>, <img>, <object>, <script>, <style>, <video> | Script to be run when an error occurs |
onfocus | All visible elements. | Script to be run when the element gets focus |
onhashchange | <body> | Script to be run when there has been changes to the anchor part of the a URL |
oninput | All visible elements. | Script to be run when the element gets user input |
oninvalid | All visible elements. | Script to be run when the element is invalid |
onkeydown | All visible elements. | Script to be run when a user is pressing a key |
onkeypress | All visible elements. | Script to be run when a user presses a key |
onkeyup | All visible elements. | Script to be run when a user releases a key |
onload | <body>, <iframe>, <img>, <input>, <link>, <script>, <style> | Script to be run when the element is finished loading |
onloadeddata | <audio>, <video> | Script to be run when media data is loaded |
onloadedmetadata | <audio>, <video> | Script to be run when meta data (like dimensions and duration) are loaded |
onloadstart | <audio>, <video> | Script to be run just as the file begins to load before anything is actually loaded |
onmousedown | All visible elements. | Script to be run when a mouse button is pressed down on an element |
onmousemove | All visible elements. | Script to be run as long as the mouse pointer is moving over an element |
onmouseout | All visible elements. | Script to be run when a mouse pointer moves out of an element |
onmouseover | All visible elements. | Script to be run when a mouse pointer moves over an element |
onmouseup | All visible elements. | Script to be run when a mouse button is released over an element |
onmousewheel | All visible elements. | Script to be run when a mouse wheel is being scrolled over an element |
onoffline | <body> | Script to be run when the browser starts to work offline |
ononline | <body> | Script to be run when the browser starts to work online |
onpagehide | <body> | Script to be run when a user navigates away from a page |
onpageshow | <body> | Script to be run when a user navigates to a page |
onpaste | All visible elements. | Script to be run when the user pastes some content in an element |
onpause | <audio>, <video> | Script to be run when the media is paused either by the user or programmatically |
onplay | <audio>, <video> | Script to be run when the media has started playing |
onplaying | <audio>, <video> | Script to be run when the media has started playing |
onpopstate | <body> | Script to be run when the window’s history changes. |
onprogress | <audio>, <video> | Script to be run when the browser is in the process of getting the media data |
onratechange | <audio>, <video> | Script to be run each time the playback rate changes (like when a user switches to a slow motion or fast forward mode). |
onreset | <form> | Script to be run when a reset button in a form is clicked. |
onresize | <body> | Script to be run when the browser window is being resized. |
onscroll | All visible elements. | Script to be run when an element’s scrollbar is being scrolled |
onsearch | <input> | Script to be run when the user writes something in a search field (for <input=”search”>) |
onseeked | <audio>, <video> | Script to be run when the seeking attribute is set to false indicating that seeking has ended |
onseeking | <audio>, <video> | Script to be run when the seeking attribute is set to true indicating that seeking is active |
onselect | All visible elements. | Script to be run when the element gets selected |
onstalled | <audio>, <video> | Script to be run when the browser is unable to fetch the media data for whatever reason |
onstorage | <body> | Script to be run when a Web Storage area is updated |
onsubmit | <form> | Script to be run when a form is submitted |
onsuspend | <audio>, <video> | Script to be run when fetching the media data is stopped before it is completely loaded for whatever reason |
ontimeupdate | <audio>, <video> | Script to be run when the playing position has changed (like when the user fast forwards to a different point in the media) |
ontoggle | <details> | Script to be run when the user opens or closes the <details> element |
onunload | <body> | Script to be run when a page has unloaded (or the browser window has been closed) |
onvolumechange | <audio>, <video> | Script to be run each time the volume of a video/audio has been changed |
onwaiting | <audio>, <video> | Script to be run when the media has paused but is expected to resume (like when the media pauses to buffer more data) |
onwheel | All visible elements. | Script to be run when the mouse wheel rolls up or down over an element |
open | <details> | Specifies that the details should be visible (open) to the user |
optimum | <meter> | Specifies what value is the optimal value for the gauge |
pattern | <input> | Specifies a regular expression that an <input> element’s value is checked against |
placeholder | <input>, <textarea> | Specifies a short hint that describes the expected value of the element |
poster | <video> | Specifies an image to be shown while the video is downloading, or until the user hits the play button |
preload | <audio>, <video> | Specifies if and how the author thinks the audio/video should be loaded when the page loads |
readonly | <input>, <textarea> | Specifies that the element is read-only |
rel | <a>, <area>, <form>, <link> | Specifies the relationship between the current document and the linked document |
required | <input>, <select>, <textarea> | Specifies that the element must be filled out before submitting the form |
reversed | <ol> | Specifies that the list order should be descending (9,8,7…) |
rows | <textarea> | Specifies the visible number of lines in a text area |
rowspan | <td>, <th> | Specifies the number of rows a table cell should span |
sandbox | <iframe> | Enables an extra set of restrictions for the content in an <iframe> |
scope | <th> | Specifies whether a header cell is a header for a column, row, or group of columns or rows |
selected | <option> | Specifies that an option should be pre-selected when the page loads |
shape | <area> | Specifies the shape of the area |
size | <input>, <select> | Specifies the width, in characters (for <input>) or specifies the number of visible options (for <select>) |
sizes | <img>, <link>, <source> | Specifies the size of the linked resource |
span | <col>, <colgroup> | Specifies the number of columns to span |
spellcheck | Global Attributes | Specifies whether the element is to have its spelling and grammar checked or not |
src | <audio>, <embed>, <iframe>, <img>, <input>, <script>, <source>, <track>, <video> | Specifies the URL of the media file |
srcdoc | <iframe> | Specifies the HTML content of the page to show in the <iframe> |
srclang | <track> | Specifies the language of the track text data (required if kind=”subtitles”) |
srcset | <img>, <source> | Specifies the URL of the image to use in different situations |
start | <ol> | Specifies the start value of an ordered list |
step | <input> | Specifies the legal number intervals for an input field |
style | Global Attributes | Specifies an inline CSS style for an element |
tabindex | Global Attributes | Specifies the tabbing order of an element |
target | <a>, <area>, <base>, <form> | Specifies the target for where to open the linked document or where to submit the form |
title | Global Attributes | Specifies extra information about an element |
translate | Global Attributes | Specifies whether the content of an element should be translated or not |
type | <a>, <button>, <embed>, <input>, <link>, <menu>, <object>, <script>, <source>, <style> | Specifies the type of element |
usemap | <img>, <object> | Specifies an image as a client-side image map |
value | <button>, <input>, <li>, <option>, <meter>, <progress>, <param> | Specifies the value of the element |
width | <canvas>, <embed>, <iframe>, <img>, <input>, <object>, <video> | Specifies the width of the element |
wrap | <textarea> | Specifies how the text in a text area is to be wrapped when submitted in a form |
HTML Global Attributes
The global attributes are attributes that can be used with all HTML elements.
Attribute | Description |
---|---|
accesskey | Specifies a shortcut key to activate/focus an element |
class | Specifies one or more classnames for an element (refers to a class in a style sheet) |
contenteditable | Specifies whether the content of an element is editable or not |
data-* | Used to store custom data private to the page or application |
dir | Specifies the text direction for the content in an element |
draggable | Specifies whether an element is draggable or not |
hidden | Specifies that an element is not yet, or is no longer, relevant |
id | Specifies a unique id for an element |
lang | Specifies the language of the element’s content |
spellcheck | Specifies whether the element is to have its spelling and grammar checked or not |
style | Specifies an inline CSS style for an element |
tabindex | Specifies the tabbing order of an element |
title | Specifies extra information about an element |
translate | Specifies whether the content of an element should be translated or not |
Global Event Attributes
HTML has the ability to let events trigger actions in a browser, like starting a JavaScript when a user clicks on an element.
To learn more about programming events, please visit our JavaScript tutorial.
Below are the global event attributes that can be added to HTML elements to define event actions.
Window Event Attributes
Events triggered for the window object (applies to the <body> tag):
Attribute | Value | Description |
---|---|---|
onafterprint | script | Script to be run after the document is printed |
onbeforeprint | script | Script to be run before the document is printed |
onbeforeunload | script | Script to be run when the document is about to be unloaded |
onerror | script | Script to be run when an error occurs |
onhashchange | script | Script to be run when there has been changes to the anchor part of the a URL |
onload | script | Fires after the page is finished loading |
onmessage | script | Script to be run when the message is triggered |
onoffline | script | Script to be run when the browser starts to work offline |
ononline | script | Script to be run when the browser starts to work online |
onpagehide | script | Script to be run when a user navigates away from a page |
onpageshow | script | Script to be run when a user navigates to a page |
onpopstate | script | Script to be run when the window’s history changes |
onresize | script | Fires when the browser window is resized |
onstorage | script | Script to be run when a Web Storage area is updated |
onunload | script | Fires once a page has unloaded (or the browser 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):
Attribute | Value | Description |
---|---|---|
onblur | script | Fires the moment that the element loses focus |
onchange | script | Fires the moment when the value of the element is changed |
oncontextmenu | script | Script to be run when a context menu is triggered |
onfocus | script | Fires the moment when the element gets focus |
oninput | script | Script to be run when an element gets user input |
oninvalid | script | Script to be run when an element is invalid |
onreset | script | Fires when the Reset button in a form is clicked |
onsearch | script | Fires when the user writes something in a search field (for <input=”search”>) |
onselect | script | Fires after some text has been selected in an element |
onsubmit | script | Fires when a form is submitted |
Keyboard Events
Attribute | Value | Description |
---|---|---|
onkeydown | script | Fires when a user is pressing a key |
onkeypress | script | Fires when a user presses a key |
onkeyup | script | Fires when a user releases a key |
Mouse Events
Attribute | Value | Description |
---|---|---|
onclick | script | Fires on a mouse click on the element |
ondblclick | script | Fires on a mouse double-click on the element |
onmousedown | script | Fires when a mouse button is pressed down on an element |
onmousemove | script | Fires when the mouse pointer is moving while it is over an element |
onmouseout | script | Fires when the mouse pointer moves out of an element |
onmouseover | script | Fires when the mouse pointer moves over an element |
onmouseup | script | Fires when a mouse button is released over an element |
onmousewheel | script | Deprecated. Use the onwheel attribute instead |
onwheel | script | Fires when the mouse wheel rolls up or down over an element |
Drag Events
Attribute | Value | Description |
---|---|---|
ondrag | script | Script to be run when an element is dragged |
ondragend | script | Script to be run at the end of a drag operation |
ondragenter | script | Script to be run when an element has been dragged to a valid drop target |
ondragleave | script | Script to be run when an element leaves a valid drop target |
ondragover | script | Script to be run when an element is being dragged over a valid drop target |
ondragstart | script | Script to be run at the start of a drag operation |
ondrop | script | Script to be run when dragged element is being dropped |
onscroll | script | Script to be run when an element’s scrollbar is being scrolled |
Clipboard Events
Attribute | Value | Description |
---|---|---|
oncopy | script | Fires when the user copies the content of an element |
oncut | script | Fires when the user cuts the content of an element |
onpaste | script | Fires when the user pastes some content in an element |
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>).
Tip: Look at our HTML Audio and Video DOM Reference for more information.
Attribute | Value | Description |
---|---|---|
onabort | script | Script to be run on abort |
oncanplay | script | Script to be run when a file is ready to start playing (when it has buffered enough to begin) |
oncanplaythrough | script | Script to be run when a file can be played all the way to the end without pausing for buffering |
oncuechange | script | Script to be run when the cue changes in a <track> element |
ondurationchange | script | Script to be run when the length of the media changes |
onemptied | script | Script to be run when something bad happens and the file is suddenly unavailable (like unexpectedly disconnects) |
onended | script | Script to be run when the media has reach the end (a useful event for messages like “thanks for listening”) |
onerror | script | Script to be run when an error occurs when the file is being loaded |
onloadeddata | script | Script to be run when media data is loaded |
onloadedmetadata | script | Script to be run when meta data (like dimensions and duration) are loaded |
onloadstart | script | Script to be run just as the file begins to load before anything is actually loaded |
onpause | script | Script to be run when the media is paused either by the user or programmatically |
onplay | script | Script to be run when the media is ready to start playing |
onplaying | script | Script to be run when the media actually has started playing |
onprogress | script | Script to be run when the browser is in the process of getting the media data |
onratechange | script | Script to be run each time the playback rate changes (like when a user switches to a slow motion or fast forward mode) |
onseeked | script | Script to be run when the seeking attribute is set to false indicating that seeking has ended |
onseeking | script | Script to be run when the seeking attribute is set to true indicating that seeking is active |
onstalled | script | Script to be run when the browser is unable to fetch the media data for whatever reason |
onsuspend | script | Script to be run when fetching the media data is stopped before it is completely loaded for whatever reason |
ontimeupdate | script | Script to be run when the playing position has changed (like when the user fast forwards to a different point in the media) |
onvolumechange | script | Script to be run each time the volume is changed which (includes setting the volume to “mute”) |
onwaiting | script | Script to be run when the media has paused but is expected to resume (like when the media pauses to buffer more data) |
Misc Events
Attribute | Value | Description |
---|---|---|
ontoggle | script | Fires when the user opens or closes the <details> 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):
For a full overview of HTML colors, visit our colors tutorial.AliceBlue
#F0F8FFAntiqueWhite
#FAEBD7Aqua
#00FFFFAquamarine
#7FFFD4Azure
#F0FFFFBeige
#F5F5DCBisque
#FFE4C4Black
#000000BlanchedAlmond
#FFEBCDBlue
#0000FFBlueViolet
#8A2BE2Brown
#A52A2ABurlyWood
#DEB887CadetBlue
#5F9EA0Chartreuse
#7FFF00Chocolate
#D2691ECoral
#FF7F50CornflowerBlue
#6495EDCornsilk
#FFF8DCCrimson
#DC143CCyan
#00FFFFDarkBlue
#00008BDarkCyan
#008B8BDarkGoldenRod
#B8860BDarkGray
#A9A9A9DarkGrey
#A9A9A9DarkGreen
#006400DarkKhaki
#BDB76BDarkMagenta
#8B008BDarkOliveGreen
#556B2FDarkOrange
#FF8C00DarkOrchid
#9932CCDarkRed
#8B0000DarkSalmon
#E9967ADarkSeaGreen
#8FBC8FDarkSlateBlue
#483D8BDarkSlateGray
#2F4F4FDarkSlateGrey
#2F4F4FDarkTurquoise
#00CED1DarkViolet
#9400D3DeepPink
#FF1493DeepSkyBlue
#00BFFFDimGray
#696969DimGrey
#696969DodgerBlue
#1E90FFFireBrick
#B22222FloralWhite
#FFFAF0ForestGreen
#228B22Fuchsia
#FF00FFGainsboro
#DCDCDCGhostWhite
#F8F8FFGold
#FFD700GoldenRod
#DAA520Gray
#808080Grey
#808080Green
#008000GreenYellow
#ADFF2FHoneyDew
#F0FFF0HotPink
#FF69B4IndianRed
#CD5C5CIndigo
#4B0082Ivory
#FFFFF0Khaki
#F0E68CLavender
#E6E6FALavenderBlush
#FFF0F5LawnGreen
#7CFC00LemonChiffon
#FFFACDLightBlue
#ADD8E6LightCoral
#F08080LightCyan
#E0FFFFLightGoldenRodYellow
#FAFAD2LightGray
#D3D3D3LightGrey
#D3D3D3LightGreen
#90EE90LightPink
#FFB6C1LightSalmon
#FFA07ALightSeaGreen
#20B2AALightSkyBlue
#87CEFALightSlateGray
#778899LightSlateGrey
#778899LightSteelBlue
#B0C4DELightYellow
#FFFFE0Lime
#00FF00LimeGreen
#32CD32Linen
#FAF0E6Magenta
#FF00FFMaroon
#800000MediumAquaMarine
#66CDAAMediumBlue
#0000CDMediumOrchid
#BA55D3MediumPurple
#9370DBMediumSeaGreen
#3CB371MediumSlateBlue
#7B68EEMediumSpringGreen
#00FA9AMediumTurquoise
#48D1CCMediumVioletRed
#C71585MidnightBlue
#191970MintCream
#F5FFFAMistyRose
#FFE4E1Moccasin
#FFE4B5NavajoWhite
#FFDEADNavy
#000080OldLace
#FDF5E6Olive
#808000OliveDrab
#6B8E23Orange
#FFA500OrangeRed
#FF4500Orchid
#DA70D6PaleGoldenRod
#EEE8AAPaleGreen
#98FB98PaleTurquoise
#AFEEEEPaleVioletRed
#DB7093PapayaWhip
#FFEFD5PeachPuff
#FFDAB9Peru
#CD853FPink
#FFC0CBPlum
#DDA0DDPowderBlue
#B0E0E6Purple
#800080RebeccaPurple
#663399Red
#FF0000RosyBrown
#BC8F8FRoyalBlue
#4169E1SaddleBrown
#8B4513Salmon
#FA8072SandyBrown
#F4A460SeaGreen
#2E8B57SeaShell
#FFF5EESienna
#A0522DSilver
#C0C0C0SkyBlue
#87CEEBSlateBlue
#6A5ACDSlateGray
#708090SlateGrey
#708090Snow
#FFFAFASpringGreen
#00FF7FSteelBlue
#4682B4Tan
#D2B48CTeal
#008080Thistle
#D8BFD8Tomato
#FF6347Turquoise
#40E0D0Violet
#EE82EEWheat
#F5DEB3White
#FFFFFFWhiteSmoke
#F5F5F5Yellow
#FFFF00YellowGreen
#9ACD32
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): For a full overview of HTML colors, visit our colors tutorial. AliceBlue #F0F8FF AntiqueWhite #FAEBD7 Aqua #00FFFF Aquamarine #7FFFD4 Azure #F0FFFF Beige #F5F5DC Bisque #FFE4C4 Black #000000 BlanchedAlmond #FFEBCD Blue #0000FF BlueViolet #8A2BE2 Brown #A52A2A BurlyWood #DEB887 CadetBlue #5F9EA0 Chartreuse #7FFF00 Chocolate #D2691E Coral #FF7F50 CornflowerBlue #6495ED Cornsilk #FFF8DC Crimson #DC143C Cyan #00FFFF DarkBlue #00008B DarkCyan #008B8B DarkGoldenRod #B8860B DarkGray #A9A9A9 DarkGrey #A9A9A9 DarkGreen #006400 DarkKhaki #BDB76B DarkMagenta #8B008B DarkOliveGreen #556B2F DarkOrange #FF8C00 DarkOrchid #9932CC DarkRed #8B0000 DarkSalmon #E9967A DarkSeaGreen #8FBC8F DarkSlateBlue #483D8B DarkSlateGray #2F4F4F DarkSlateGrey #2F4F4F DarkTurquoise #00CED1 DarkViolet #9400D3 DeepPink #FF1493 DeepSkyBlue #00BFFF DimGray #696969 DimGrey #696969 DodgerBlue #1E90FF FireBrick #B22222 FloralWhite #FFFAF0 ForestGreen #228B22 Fuchsia #FF00FF Gainsboro #DCDCDC GhostWhite #F8F8FF Gold #FFD700 GoldenRod #DAA520 Gray #808080 Grey #808080 Green #008000 GreenYellow #ADFF2F HoneyDew #F0FFF0 HotPink #FF69B4 IndianRed #CD5C5C Indigo #4B0082 Ivory #FFFFF0 Khaki #F0E68C Lavender #E6E6FA LavenderBlush #FFF0F5 LawnGreen #7CFC00 LemonChiffon #FFFACD LightBlue #ADD8E6 LightCoral #F08080 LightCyan #E0FFFF LightGoldenRodYellow #FAFAD2 LightGray #D3D3D3 LightGrey #D3D3D3 LightGreen #90EE90 LightPink #FFB6C1 LightSalmon #FFA07A LightSeaGreen #20B2AA LightSkyBlue #87CEFA LightSlateGray #778899 LightSlateGrey #778899 LightSteelBlue #B0C4DE LightYellow #FFFFE0 Lime #00FF00 LimeGreen #32CD32 Linen #FAF0E6 Magenta #FF00FF Maroon #800000 MediumAquaMarine #66CDAA MediumBlue #0000CD MediumOrchid #BA55D3 MediumPurple #9370DB MediumSeaGreen #3CB371 MediumSlateBlue #7B68EE MediumSpringGreen #00FA9A MediumTurquoise #48D1CC MediumVioletRed #C71585 MidnightBlue #191970 MintCream #F5FFFA MistyRose #FFE4E1 Moccasin #FFE4B5 NavajoWhite #FFDEAD Navy #000080 OldLace #FDF5E6 Olive #808000 OliveDrab #6B8E23 Orange #FFA500 OrangeRed #FF4500 Orchid #DA70D6 PaleGoldenRod #EEE8AA PaleGreen #98FB98 PaleTurquoise #AFEEEE PaleVioletRed #DB7093 PapayaWhip #FFEFD5 PeachPuff #FFDAB9 Peru #CD853F Pink #FFC0CB Plum #DDA0DD PowderBlue #B0E0E6 Purple #800080 RebeccaPurple #663399 Red #FF0000 RosyBrown #BC8F8F RoyalBlue #4169E1 SaddleBrown #8B4513 Salmon #FA8072 SandyBrown #F4A460 SeaGreen #2E8B57 SeaShell #FFF5EE Sienna #A0522D Silver #C0C0C0 SkyBlue #87CEEB SlateBlue #6A5ACD SlateGray #708090 SlateGrey #708090 Snow #FFFAFA SpringGreen #00FF7F SteelBlue #4682B4 Tan #D2B48C Teal #008080 Thistle #D8BFD8 Tomato #FF6347 Turquoise #40E0D0 Violet #EE82EE Wheat #F5DEB3 White #FFFFFF WhiteSmoke #F5F5F5 Yellow #FFFF00 YellowGreen #9ACD32
HTML Canvas Reference
The HTML <canvas>
tag is used to draw graphics, on the fly, via scripting (usually JavaScript).
To learn more about <canvas>
, please read our HTML Canvas tutorial.
Colors, Styles, and Shadows
Property | Description |
---|---|
fillStyle | Sets or returns the color, gradient, or pattern used to fill the drawing |
strokeStyle | Sets or returns the color, gradient, or pattern used for strokes |
shadowColor | Sets or returns the color to use for shadows |
shadowBlur | Sets or returns the blur level for shadows |
shadowOffsetX | Sets or returns the horizontal distance of the shadow from the shape |
shadowOffsetY | Sets or returns the vertical distance of the shadow from the shape |
Method | Description |
---|---|
createLinearGradient() | Creates a linear gradient (to use on canvas content) |
createPattern() | Repeats a specified element in the specified direction |
createRadialGradient() | Creates a radial/circular gradient (to use on canvas content) |
addColorStop() | Specifies the colors and stop positions in a gradient object |
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 |
lineWidth | Sets or returns the current line width |
miterLimit | Sets or returns the maximum miter length |
Rectangles
Method | Description |
---|---|
rect() | Creates a rectangle |
fillRect() | Draws a “filled” rectangle |
strokeRect() | Draws a rectangle (no fill) |
clearRect() | Clears the specified pixels within a given rectangle |
Paths
Method | Description |
---|---|
fill() | Fills the current drawing (path) |
stroke() | Actually draws the path you have defined |
beginPath() | Begins a path, or resets the current path |
moveTo() | Moves the path to the specified point in the canvas, without creating a line |
closePath() | Creates a path from the current point back to the starting point |
lineTo() | Adds a new point and creates a line to that point from the last specified point in the canvas |
clip() | Clips a region of any shape and size from the original canvas |
quadraticCurveTo() | Creates a quadratic Bรฉzier curve |
bezierCurveTo() | Creates a cubic Bรฉzier curve |
arc() | Creates an arc/curve (used to create circles, or parts of circles) |
arcTo() | Creates an arc/curve between two tangents |
isPointInPath() | Returns true if the specified point is in the current path, otherwise false |
Transformations
Method | Description |
---|---|
scale() | Scales the current drawing bigger or smaller |
rotate() | Rotates the current drawing |
translate() | Remaps the (0,0) position on the canvas |
transform() | Replaces the current transformation matrix for the drawing |
setTransform() | Resets the current transform to the identity matrix. Then runs transform() |
Text
Property | Description |
---|---|
font | Sets or returns the current font properties for text content |
textAlign | Sets or returns the current alignment for text content |
textBaseline | Sets or returns the current text baseline used when drawing text |
Method | Description |
---|---|
fillText() | Draws “filled” text on the canvas |
strokeText() | Draws text on the canvas (no fill) |
measureText() | Returns an object that contains the width of the specified text |
Image Drawing
Method | Description |
---|---|
drawImage() | Draws an image, canvas, or video onto the canvas |
Pixel Manipulation
Property | Description |
---|---|
width | Returns the width of an ImageData object |
height | Returns the height of an ImageData object |
data | Returns an object that contains image data of a specified ImageData object |
Method | Description |
---|---|
createImageData() | Creates a new, blank ImageData object |
getImageData() | Returns an ImageData object that copies the pixel data for the specified rectangle on a canvas |
putImageData() | Puts the image data (from a specified ImageData object) back onto the canvas |
Compositing
Property | Description |
---|---|
globalAlpha | Sets or returns the current alpha or transparency value of the drawing |
globalCompositeOperation | Sets or returns how a new image is drawn onto an existing image |
Other
Method | Description |
---|---|
save() | Saves the state of the current context |
restore() | Returns previously saved path state and attributes |
createEvent() | |
getContext() | |
toDataURL() |
HTML Audio and Video DOM Reference
The HTML5 DOM has methods, properties, and events for the <audio>
and <video>
elements.
HTML Audio/Video Methods
Method | Description |
---|---|
addTextTrack() | Adds a new text track to the audio/video |
canPlayType() | Checks if the browser can play the specified audio/video type |
load() | Re-loads the audio/video element |
play() | Starts playing the audio/video |
pause() | Pauses the currently playing audio/video |
HTML Audio/Video Properties
Property | Description |
---|---|
audioTracks | Returns an AudioTrackList object representing available audio tracks |
autoplay | Sets or returns whether the audio/video should start playing as soon as it is loaded |
buffered | Returns a TimeRanges object representing the buffered parts of the audio/video |
controller | Returns the MediaController object representing the current media controller of the audio/video |
controls | Sets or returns whether the audio/video should display controls (like play/pause etc.) |
crossOrigin | Sets or returns the CORS settings of the audio/video |
currentSrc | Returns the URL of the current audio/video |
currentTime | Sets or returns the current playback position in the audio/video (in seconds) |
defaultMuted | Sets or returns whether the audio/video should be muted by default |
defaultPlaybackRate | Sets or returns the default speed of the audio/video playback |
duration | Returns the length of the current audio/video (in seconds) |
ended | Returns whether the playback of the audio/video has ended or not |
error | Returns a MediaError object representing the error state of the audio/video |
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) |
muted | Sets or returns whether the audio/video is muted or not |
networkState | Returns the current network state of the audio/video |
paused | Returns whether the audio/video is paused or not |
playbackRate | Sets or returns the speed of the audio/video playback |
played | Returns a TimeRanges object representing the played parts of the audio/video |
preload | Sets or returns whether the audio/video should be loaded when the page loads |
readyState | Returns the current ready state of the audio/video |
seekable | Returns a TimeRanges object representing the seekable parts of the audio/video |
seeking | Returns whether the user is currently seeking in the audio/video |
src | Sets or returns the current source of the audio/video element |
startDate | Returns a Date object representing the current time offset |
textTracks | Returns a TextTrackList object representing the available text tracks |
videoTracks | Returns a VideoTrackList object representing the available video tracks |
volume | Sets or returns the volume of the audio/video |
HTML Audio/Video Events
Event | Description |
---|---|
abort | Fires when the loading of an audio/video is aborted |
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 |
durationchange | Fires when the duration of the audio/video is changed |
emptied | Fires when the current playlist is empty |
ended | Fires when the current playlist is ended |
error | Fires when an error occurred during the loading of an audio/video |
loadeddata | Fires when the browser has loaded the current frame of the audio/video |
loadedmetadata | Fires when the browser has loaded meta data for the audio/video |
loadstart | Fires when the browser starts looking for the audio/video |
pause | Fires when the audio/video has been paused |
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 |
progress | Fires when the browser is downloading the audio/video |
ratechange | Fires when the playing speed of the audio/video is changed |
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 |
timeupdate | Fires when the current playback position has changed |
volumechange | Fires when the volume has been changed |
waiting | Fires when the video stops because it needs to buffer the next frame |
Common HTML Character Sets
The default character set in HTML5 is UTF-8.
For a closer look, visit our Complete HTML Character Set Reference.
Number | ASCII | ANSI | 8859-1 | UTF-8 | Description |
---|---|---|---|---|---|
32 | space | ||||
33 | ! | ! | ! | ! | exclamation mark |
34 | “ | “ | “ | “ | quotation mark |
35 | # | # | # | # | number sign |
36 | $ | $ | $ | $ | dollar sign |
37 | % | % | % | % | percent sign |
38 | & | & | & | & | ampersand |
39 | ‘ | ‘ | ‘ | ‘ | apostrophe |
40 | ( | ( | ( | ( | left parenthesis |
41 | ) | ) | ) | ) | right parenthesis |
42 | * | * | * | * | asterisk |
43 | + | + | + | + | plus sign |
44 | , | , | , | , | comma |
45 | – | – | – | – | hyphen-minus |
46 | . | . | . | . | full stop |
47 | / | / | / | / | solidus |
48 | 0 | 0 | 0 | 0 | digit zero |
49 | 1 | 1 | 1 | 1 | digit one |
50 | 2 | 2 | 2 | 2 | digit two |
51 | 3 | 3 | 3 | 3 | digit three |
52 | 4 | 4 | 4 | 4 | digit four |
53 | 5 | 5 | 5 | 5 | digit five |
54 | 6 | 6 | 6 | 6 | digit six |
55 | 7 | 7 | 7 | 7 | digit seven |
56 | 8 | 8 | 8 | 8 | digit eight |
57 | 9 | 9 | 9 | 9 | digit nine |
58 | : | : | : | : | colon |
59 | ; | ; | ; | ; | semicolon |
60 | < | < | < | < | less-than sign |
61 | = | = | = | = | equals sign |
62 | > | > | > | > | greater-than sign |
63 | ? | ? | ? | ? | question mark |
64 | @ | @ | @ | @ | commercial at |
65 | A | A | A | A | Latin capital letter A |
66 | B | B | B | B | Latin capital letter B |
67 | C | C | C | C | Latin capital letter C |
68 | D | D | D | D | Latin capital letter D |
69 | E | E | E | E | Latin capital letter E |
70 | F | F | F | F | Latin capital letter F |
71 | G | G | G | G | Latin capital letter G |
72 | H | H | H | H | Latin capital letter H |
73 | I | I | I | I | Latin capital letter I |
74 | J | J | J | J | Latin capital letter J |
75 | K | K | K | K | Latin capital letter K |
76 | L | L | L | L | Latin capital letter L |
77 | M | M | M | M | Latin capital letter M |
78 | N | N | N | N | Latin capital letter N |
79 | O | O | O | O | Latin capital letter O |
80 | P | P | P | P | Latin capital letter P |
81 | Q | Q | Q | Q | Latin capital letter Q |
82 | R | R | R | R | Latin capital letter R |
83 | S | S | S | S | Latin capital letter S |
84 | T | T | T | T | Latin capital letter T |
85 | U | U | U | U | Latin capital letter U |
86 | V | V | V | V | Latin capital letter V |
87 | W | W | W | W | Latin capital letter W |
88 | X | X | X | X | Latin capital letter X |
89 | Y | Y | Y | Y | Latin capital letter Y |
90 | Z | Z | Z | Z | Latin capital letter Z |
91 | [ | [ | [ | [ | left square bracket |
92 | \ | \ | \ | \ | reverse solidus |
93 | ] | ] | ] | ] | right square bracket |
94 | ^ | ^ | ^ | ^ | circumflex accent |
95 | _ | _ | _ | _ | low line |
96 | ` | ` | ` | ` | grave accent |
97 | a | a | a | a | Latin small letter a |
98 | b | b | b | b | Latin small letter b |
99 | c | c | c | c | Latin small letter c |
100 | d | d | d | d | Latin small letter d |
101 | e | e | e | e | Latin small letter e |
102 | f | f | f | f | Latin small letter f |
103 | g | g | g | g | Latin small letter g |
104 | h | h | h | h | Latin small letter h |
105 | i | i | i | i | Latin small letter i |
106 | j | j | j | j | Latin small letter j |
107 | k | k | k | k | Latin small letter k |
108 | l | l | l | l | Latin small letter l |
109 | m | m | m | m | Latin small letter m |
110 | n | n | n | n | Latin small letter n |
111 | o | o | o | o | Latin small letter o |
112 | p | p | p | p | Latin small letter p |
113 | q | q | q | q | Latin small letter q |
114 | r | r | r | r | Latin small letter r |
115 | s | s | s | s | Latin small letter s |
116 | t | t | t | t | Latin small letter t |
117 | u | u | u | u | Latin small letter u |
118 | v | v | v | v | Latin small letter v |
119 | w | w | w | w | Latin small letter w |
120 | x | x | x | x | Latin small letter x |
121 | y | y | y | y | Latin small letter y |
122 | z | z | z | z | Latin small letter z |
123 | { | { | { | { | left curly bracket |
124 | | | | | | | | | vertical line |
125 | } | } | } | } | right curly bracket |
126 | ~ | ~ | ~ | ~ | tilde |
127 | DEL | ||||
128 | โฌ | euro sign | |||
129 | ย | ย | ย | NOT USED | |
130 | โ | single low-9 quotation mark | |||
131 | ฦ | Latin small letter f with hook | |||
132 | โ | double low-9 quotation mark | |||
133 | โฆ | horizontal ellipsis | |||
134 | โ | dagger | |||
135 | โก | double dagger | |||
136 | ห | modifier letter circumflex accent | |||
137 | โฐ | per mille sign | |||
138 | ล | Latin capital letter S with caron | |||
139 | โน | single left-pointing angle quotation mark | |||
140 | ล | Latin capital ligature OE | |||
141 | ย | ย | ย | NOT USED | |
142 | ลฝ | Latin capital letter Z with caron | |||
143 | ย | ย | ย | NOT USED | |
144 | ย | ย | ย | NOT USED | |
145 | โ | left single quotation mark | |||
146 | โ | right single quotation mark | |||
147 | โ | left double quotation mark | |||
148 | โ | right double quotation mark | |||
149 | โข | bullet | |||
150 | โ | en dash | |||
151 | โ | em dash | |||
152 | ห | small tilde | |||
153 | โข | trade mark sign | |||
154 | ลก | Latin small letter s with caron | |||
155 | โบ | single right-pointing angle quotation mark | |||
156 | ล | Latin small ligature oe | |||
157 | ย | ย | ย | NOT USED | |
158 | ลพ | Latin small letter z with caron | |||
159 | ลธ | Latin capital letter Y with diaeresis | |||
160 | no-break space | ||||
161 | ยก | ยก | ยก | inverted exclamation mark | |
162 | ยข | ยข | ยข | cent sign | |
163 | ยฃ | ยฃ | ยฃ | pound sign | |
164 | ยค | ยค | ยค | currency sign | |
165 | ยฅ | ยฅ | ยฅ | yen sign | |
166 | ยฆ | ยฆ | ยฆ | broken bar | |
167 | ยง | ยง | ยง | section sign | |
168 | ยจ | ยจ | ยจ | diaeresis | |
169 | ยฉ | ยฉ | ยฉ | copyright sign | |
170 | ยช | ยช | ยช | feminine ordinal indicator | |
171 | ยซ | ยซ | ยซ | left-pointing double angle quotation mark | |
172 | ยฌ | ยฌ | ยฌ | not sign | |
173 | ยญ | ยญ | ยญ | soft hyphen | |
174 | ยฎ | ยฎ | ยฎ | registered sign | |
175 | ยฏ | ยฏ | ยฏ | macron | |
176 | ยฐ | ยฐ | ยฐ | degree sign | |
177 | ยฑ | ยฑ | ยฑ | plus-minus sign | |
178 | ยฒ | ยฒ | ยฒ | superscript two | |
179 | ยณ | ยณ | ยณ | superscript three | |
180 | ยด | ยด | ยด | acute accent | |
181 | ยต | ยต | ยต | micro sign | |
182 | ยถ | ยถ | ยถ | pilcrow sign | |
183 | ยท | ยท | ยท | middle dot | |
184 | ยธ | ยธ | ยธ | cedilla | |
185 | ยน | ยน | ยน | superscript one | |
186 | ยบ | ยบ | ยบ | masculine ordinal indicator | |
187 | ยป | ยป | ยป | right-pointing double angle quotation mark | |
188 | ยผ | ยผ | ยผ | vulgar fraction one quarter | |
189 | ยฝ | ยฝ | ยฝ | vulgar fraction one half | |
190 | ยพ | ยพ | ยพ | vulgar fraction three quarters | |
191 | ยฟ | ยฟ | ยฟ | inverted question mark | |
192 | ร | ร | ร | Latin capital letter A with grave | |
193 | ร | ร | ร | Latin capital letter A with acute | |
194 | ร | ร | ร | Latin capital letter A with circumflex | |
195 | ร | ร | ร | Latin capital letter A with tilde | |
196 | ร | ร | ร | Latin capital letter A with diaeresis | |
197 | ร | ร | ร | Latin capital letter A with ring above | |
198 | ร | ร | ร | Latin capital letter AE | |
199 | ร | ร | ร | Latin capital letter C with cedilla | |
200 | ร | ร | ร | Latin capital letter E with grave | |
201 | ร | ร | ร | Latin capital letter E with acute | |
202 | ร | ร | ร | Latin capital letter E with circumflex | |
203 | ร | ร | ร | Latin capital letter E with diaeresis | |
204 | ร | ร | ร | Latin capital letter I with grave | |
205 | ร | ร | ร | Latin capital letter I with acute | |
206 | ร | ร | ร | Latin capital letter I with circumflex | |
207 | ร | ร | ร | Latin capital letter I with diaeresis | |
208 | ร | ร | ร | Latin capital letter Eth | |
209 | ร | ร | ร | Latin capital letter N with tilde | |
210 | ร | ร | ร | Latin capital letter O with grave | |
211 | ร | ร | ร | Latin capital letter O with acute | |
212 | ร | ร | ร | Latin capital letter O with circumflex | |
213 | ร | ร | ร | Latin capital letter O with tilde | |
214 | ร | ร | ร | Latin capital letter O with diaeresis | |
215 | ร | ร | ร | multiplication sign | |
216 | ร | ร | ร | Latin capital letter O with stroke | |
217 | ร | ร | ร | Latin capital letter U with grave | |
218 | ร | ร | ร | Latin capital letter U with acute | |
219 | ร | ร | ร | Latin capital letter U with circumflex | |
220 | ร | ร | ร | Latin capital letter U with diaeresis | |
221 | ร | ร | ร | Latin capital letter Y with acute | |
222 | ร | ร | ร | Latin capital letter Thorn | |
223 | ร | ร | ร | Latin small letter sharp s | |
224 | ร | ร | ร | Latin small letter a with grave | |
225 | รก | รก | รก | Latin small letter a with acute | |
226 | รข | รข | รข | Latin small letter a with circumflex | |
227 | รฃ | รฃ | รฃ | Latin small letter a with tilde | |
228 | รค | รค | รค | Latin small letter a with diaeresis | |
229 | รฅ | รฅ | รฅ | Latin small letter a with ring above | |
230 | รฆ | รฆ | รฆ | Latin small letter ae | |
231 | รง | รง | รง | Latin small letter c with cedilla | |
232 | รจ | รจ | รจ | Latin small letter e with grave | |
233 | รฉ | รฉ | รฉ | Latin small letter e with acute | |
234 | รช | รช | รช | Latin small letter e with circumflex | |
235 | รซ | รซ | รซ | Latin small letter e with diaeresis | |
236 | รฌ | รฌ | รฌ | Latin small letter i with grave | |
237 | รญ | รญ | รญ | Latin small letter i with acute | |
238 | รฎ | รฎ | รฎ | Latin small letter i with circumflex | |
239 | รฏ | รฏ | รฏ | Latin small letter i with diaeresis | |
240 | รฐ | รฐ | รฐ | Latin small letter eth | |
241 | รฑ | รฑ | รฑ | Latin small letter n with tilde | |
242 | รฒ | รฒ | รฒ | Latin small letter o with grave | |
243 | รณ | รณ | รณ | Latin small letter o with acute | |
244 | รด | รด | รด | Latin small letter o with circumflex | |
245 | รต | รต | รต | Latin small letter o with tilde | |
246 | รถ | รถ | รถ | Latin small letter o with diaeresis | |
247 | รท | รท | รท | division sign | |
248 | รธ | รธ | รธ | Latin small letter o with stroke | |
249 | รน | รน | รน | Latin small letter u with grave | |
250 | รบ | รบ | รบ | Latin small letter u with acute | |
251 | รป | รป | รป | Latin small letter with circumflex | |
252 | รผ | รผ | รผ | Latin small letter u with diaeresis | |
253 | รฝ | รฝ | รฝ | Latin small letter y with acute | |
254 | รพ | รพ | รพ | Latin small letter thorn | |
255 | รฟ | รฟ | รฟ | Latin small letter y with diaeresis |
The HTML Document Type
All HTML documents must start with a <!DOCTYPE>
declaration.
The declaration is not an HTML tag. It is an “information” to the browser about what document type to expect.
In HTML5, the <!DOCTYPE>
declaration is simple:<!DOCTYPE html>
In older documents (HTML 4 or XHTML), the declaration is more complicated because the declaration must refer to a DTD (Document Type Definition).<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “http://www.w3.org/TR/html4/loose.dtd”><!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.1//EN” “http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd”>
You can read more about document types in the <!DOCTYPE> reference.
Valid HTML Elements in Different DOCTYPES
Tag | HTML 5 | HTML 4 | XHTML |
---|---|---|---|
<a> | Yes | Yes | Yes |
<abbr> | Yes | Yes | Yes |
<acronym> | No | Yes | Yes |
<address> | Yes | Yes | Yes |
<applet> | No | Yes | No |
<area> | Yes | Yes | No |
<article> | Yes | No | No |
<aside> | Yes | No | No |
<audio> | Yes | No | No |
<b> | Yes | Yes | Yes |
<base> | Yes | Yes | Yes |
<basefont> | No | Yes | No |
<bdi> | Yes | No | No |
<bdo> | Yes | Yes | No |
<big> | No | Yes | Yes |
<blockquote> | Yes | Yes | Yes |
<body> | Yes | Yes | Yes |
<br> | Yes | Yes | Yes |
<button> | Yes | Yes | Yes |
<canvas> | Yes | No | No |
<caption> | Yes | Yes | Yes |
<center> | No | Yes | No |
<cite> | Yes | Yes | Yes |
<code> | Yes | Yes | Yes |
<col> | Yes | Yes | No |
<colgroup> | Yes | Yes | No |
<datalist> | Yes | No | No |
<dd> | Yes | Yes | Yes |
<del> | Yes | Yes | No |
<details> | Yes | No | No |
<dfn> | Yes | Yes | Yes |
<dialog> | Yes | No | No |
<dir> | No | Yes | No |
<div> | Yes | Yes | Yes |
<dl> | Yes | Yes | Yes |
<dt> | Yes | Yes | Yes |
<em> | Yes | Yes | Yes |
<embed> | Yes | No | No |
<fieldset> | Yes | Yes | Yes |
<figcaption> | Yes | No | No |
<figure> | Yes | No | No |
<font> | No | Yes | No |
<footer> | Yes | No | No |
<form> | Yes | Yes | Yes |
<frame> | No | No | No |
<frameset> | No | Yes | No |
<h1> to <h6> | Yes | Yes | Yes |
<head> | Yes | Yes | Yes |
<header> | Yes | No | No |
<hr> | Yes | Yes | Yes |
<html> | Yes | Yes | Yes |
<i> | Yes | Yes | Yes |
<iframe> | Yes | Yes | No |
<img> | Yes | Yes | Yes |
<input> | Yes | Yes | Yes |
<ins> | Yes | Yes | No |
<kbd> | Yes | Yes | Yes |
<label> | Yes | Yes | Yes |
<legend> | Yes | Yes | Yes |
<li> | Yes | Yes | Yes |
<link> | Yes | Yes | Yes |
<main> | Yes | No | No |
<map> | Yes | Yes | No |
<mark> | Yes | No | No |
<meta> | Yes | Yes | Yes |
<meter> | Yes | No | No |
<nav> | Yes | No | No |
<noframes> | No | Yes | No |
<noscript> | Yes | Yes | Yes |
<object> | Yes | Yes | Yes |
<ol> | Yes | Yes | Yes |
<optgroup> | Yes | Yes | Yes |
<option> | Yes | Yes | Yes |
<output> | Yes | No | No |
<p> | Yes | Yes | Yes |
<param> | Yes | Yes | Yes |
<pre> | Yes | Yes | Yes |
<progress> | Yes | No | No |
<q> | Yes | Yes | Yes |
<rp> | Yes | No | No |
<rt> | Yes | No | No |
<ruby> | Yes | No | No |
<s> | Yes | Yes | No |
<samp> | Yes | Yes | Yes |
<script> | Yes | Yes | Yes |
<section> | Yes | No | No |
<select> | Yes | Yes | Yes |
<small> | Yes | Yes | Yes |
<source> | Yes | No | No |
<span> | Yes | Yes | Yes |
<strike> | No | Yes | No |
<strong> | Yes | Yes | Yes |
<style> | Yes | Yes | Yes |
<sub> | Yes | Yes | Yes |
<summary> | Yes | No | No |
<sup> | Yes | Yes | Yes |
<table> | Yes | Yes | Yes |
<tbody> | Yes | Yes | No |
<td> | Yes | Yes | Yes |
<textarea> | Yes | Yes | Yes |
<tfoot> | Yes | Yes | No |
<th> | Yes | Yes | Yes |
<thead> | Yes | Yes | No |
<time> | Yes | No | No |
<title> | Yes | Yes | Yes |
<tr> | Yes | Yes | Yes |
<track> | Yes | No | No |
<tt> | No | Yes | Yes |
<u> | Yes | Yes | No |
<ul> | Yes | Yes | Yes |
<var> | Yes | Yes | Yes |
<video> | Yes | No | No |
<wbr> | Yes | No | No |
URL – Uniform Resource Locator
Web browsers request pages from web servers by using a URL.
The URL is the address of a web page, like: https://www.w3schools.com.
URL Encoding (Percent Encoding)
URL encoding converts characters into a format that can be transmitted over the Internet.
URLs can only be sent over the Internet using the ASCII character-set.
Since URLs often contain characters outside the ASCII set, the URL has to be converted into a valid ASCII format.
URL encoding replaces unsafe ASCII characters with a “%” followed by two hexadecimal digits.
URLs cannot contain spaces. URL encoding normally replaces a space with a plus (+) sign or with %20.
Try It Yourself
If you click the “Submit” button below, the browser will URL encode the input before it is sent to the server. A page at the server will display the received input.
Try some other input and click Submit again.
URL Encoding Functions
In JavaScript, PHP, and ASP there are functions that can be used to URL encode a string.
PHP has the rawurlencode() function, and ASP has the Server.URLEncode() function.
In JavaScript you can use the encodeURIComponent() function.
Click the “URL Encode” button to see how the JavaScript function encodes the text.
Note: The JavaScript function encodes space as %20.
ASCII Encoding Reference
Your browser will encode input, according to the character-set used in your page.
The default character-set in HTML5 is UTF-8.
Character | From Windows-1252 | From UTF-8 |
---|---|---|
space | %20 | %20 |
! | %21 | %21 |
“ | %22 | %22 |
# | %23 | %23 |
$ | %24 | %24 |
% | %25 | %25 |
& | %26 | %26 |
‘ | %27 | %27 |
( | %28 | %28 |
) | %29 | %29 |
* | %2A | %2A |
+ | %2B | %2B |
, | %2C | %2C |
– | %2D | %2D |
. | %2E | %2E |
/ | %2F | %2F |
0 | %30 | %30 |
1 | %31 | %31 |
2 | %32 | %32 |
3 | %33 | %33 |
4 | %34 | %34 |
5 | %35 | %35 |
6 | %36 | %36 |
7 | %37 | %37 |
8 | %38 | %38 |
9 | %39 | %39 |
: | %3A | %3A |
; | %3B | %3B |
< | %3C | %3C |
= | %3D | %3D |
> | %3E | %3E |
? | %3F | %3F |
@ | %40 | %40 |
A | %41 | %41 |
B | %42 | %42 |
C | %43 | %43 |
D | %44 | %44 |
E | %45 | %45 |
F | %46 | %46 |
G | %47 | %47 |
H | %48 | %48 |
I | %49 | %49 |
J | %4A | %4A |
K | %4B | %4B |
L | %4C | %4C |
M | %4D | %4D |
N | %4E | %4E |
O | %4F | %4F |
P | %50 | %50 |
Q | %51 | %51 |
R | %52 | %52 |
S | %53 | %53 |
T | %54 | %54 |
U | %55 | %55 |
V | %56 | %56 |
W | %57 | %57 |
X | %58 | %58 |
Y | %59 | %59 |
Z | %5A | %5A |
[ | %5B | %5B |
\ | %5C | %5C |
] | %5D | %5D |
^ | %5E | %5E |
_ | %5F | %5F |
` | %60 | %60 |
a | %61 | %61 |
b | %62 | %62 |
c | %63 | %63 |
d | %64 | %64 |
e | %65 | %65 |
f | %66 | %66 |
g | %67 | %67 |
h | %68 | %68 |
i | %69 | %69 |
j | %6A | %6A |
k | %6B | %6B |
l | %6C | %6C |
m | %6D | %6D |
n | %6E | %6E |
o | %6F | %6F |
p | %70 | %70 |
q | %71 | %71 |
r | %72 | %72 |
s | %73 | %73 |
t | %74 | %74 |
u | %75 | %75 |
v | %76 | %76 |
w | %77 | %77 |
x | %78 | %78 |
y | %79 | %79 |
z | %7A | %7A |
{ | %7B | %7B |
| | %7C | %7C |
} | %7D | %7D |
~ | %7E | %7E |
%7F | %7F | |
` | %80 | %E2%82%AC |
ย | %81 | %81 |
โ | %82 | %E2%80%9A |
ฦ | %83 | %C6%92 |
โ | %84 | %E2%80%9E |
โฆ | %85 | %E2%80%A6 |
โ | %86 | %E2%80%A0 |
โก | %87 | %E2%80%A1 |
ห | %88 | %CB%86 |
โฐ | %89 | %E2%80%B0 |
ล | %8A | %C5%A0 |
โน | %8B | %E2%80%B9 |
ล | %8C | %C5%92 |
ย | %8D | %C5%8D |
ลฝ | %8E | %C5%BD |
ย | %8F | %8F |
ย | %90 | %C2%90 |
โ | %91 | %E2%80%98 |
โ | %92 | %E2%80%99 |
โ | %93 | %E2%80%9C |
โ | %94 | %E2%80%9D |
โข | %95 | %E2%80%A2 |
โ | %96 | %E2%80%93 |
โ | %97 | %E2%80%94 |
ห | %98 | %CB%9C |
โข | %99 | %E2%84 |
ลก | %9A | %C5%A1 |
โบ | %9B | %E2%80 |
ล | %9C | %C5%93 |
ย | %9D | %9D |
ลพ | %9E | %C5%BE |
ลธ | %9F | %C5%B8 |
%A0 | %C2%A0 | |
ยก | %A1 | %C2%A1 |
ยข | %A2 | %C2%A2 |
ยฃ | %A3 | %C2%A3 |
ยค | %A4 | %C2%A4 |
ยฅ | %A5 | %C2%A5 |
ยฆ | %A6 | %C2%A6 |
ยง | %A7 | %C2%A7 |
ยจ | %A8 | %C2%A8 |
ยฉ | %A9 | %C2%A9 |
ยช | %AA | %C2%AA |
ยซ | %AB | %C2%AB |
ยฌ | %AC | %C2%AC |
ยญ | %AD | %C2%AD |
ยฎ | %AE | %C2%AE |
ยฏ | %AF | %C2%AF |
ยฐ | %B0 | %C2%B0 |
ยฑ | %B1 | %C2%B1 |
ยฒ | %B2 | %C2%B2 |
ยณ | %B3 | %C2%B3 |
ยด | %B4 | %C2%B4 |
ยต | %B5 | %C2%B5 |
ยถ | %B6 | %C2%B6 |
ยท | %B7 | %C2%B7 |
ยธ | %B8 | %C2%B8 |
ยน | %B9 | %C2%B9 |
ยบ | %BA | %C2%BA |
ยป | %BB | %C2%BB |
ยผ | %BC | %C2%BC |
ยฝ | %BD | %C2%BD |
ยพ | %BE | %C2%BE |
ยฟ | %BF | %C2%BF |
ร | %C0 | %C3%80 |
ร | %C1 | %C3%81 |
ร | %C2 | %C3%82 |
ร | %C3 | %C3%83 |
ร | %C4 | %C3%84 |
ร | %C5 | %C3%85 |
ร | %C6 | %C3%86 |
ร | %C7 | %C3%87 |
ร | %C8 | %C3%88 |
ร | %C9 | %C3%89 |
ร | %CA | %C3%8A |
ร | %CB | %C3%8B |
ร | %CC | %C3%8C |
ร | %CD | %C3%8D |
ร | %CE | %C3%8E |
ร | %CF | %C3%8F |
ร | %D0 | %C3%90 |
ร | %D1 | %C3%91 |
ร | %D2 | %C3%92 |
ร | %D3 | %C3%93 |
ร | %D4 | %C3%94 |
ร | %D5 | %C3%95 |
ร | %D6 | %C3%96 |
ร | %D7 | %C3%97 |
ร | %D8 | %C3%98 |
ร | %D9 | %C3%99 |
ร | %DA | %C3%9A |
ร | %DB | %C3%9B |
ร | %DC | %C3%9C |
ร | %DD | %C3%9D |
ร | %DE | %C3%9E |
ร | %DF | %C3%9F |
ร | %E0 | %C3%A0 |
รก | %E1 | %C3%A1 |
รข | %E2 | %C3%A2 |
รฃ | %E3 | %C3%A3 |
รค | %E4 | %C3%A4 |
รฅ | %E5 | %C3%A5 |
รฆ | %E6 | %C3%A6 |
รง | %E7 | %C3%A7 |
รจ | %E8 | %C3%A8 |
รฉ | %E9 | %C3%A9 |
รช | %EA | %C3%AA |
รซ | %EB | %C3%AB |
รฌ | %EC | %C3%AC |
รญ | %ED | %C3%AD |
รฎ | %EE | %C3%AE |
รฏ | %EF | %C3%AF |
รฐ | %F0 | %C3%B0 |
รฑ | %F1 | %C3%B1 |
รฒ | %F2 | %C3%B2 |
รณ | %F3 | %C3%B3 |
รด | %F4 | %C3%B4 |
รต | %F5 | %C3%B5 |
รถ | %F6 | %C3%B6 |
รท | %F7 | %C3%B7 |
รธ | %F8 | %C3%B8 |
รน | %F9 | %C3%B9 |
รบ | %FA | %C3%BA |
รป | %FB | %C3%BB |
รผ | %FC | %C3%BC |
รฝ | %FD | %C3%BD |
รพ | %FE | %C3%BE |
รฟ | %FF | %C3%BF |
URL Encoding Reference
The ASCII control characters %00-%1F were originally designed to control hardware devices.
Control characters have nothing to do inside a URL.
ASCII Character | Description | URL-encoding |
---|---|---|
NUL | null character | %00 |
SOH | start of header | %01 |
STX | start of text | %02 |
ETX | end of text | %03 |
EOT | end of transmission | %04 |
ENQ | enquiry | %05 |
ACK | acknowledge | %06 |
BEL | bell (ring) | %07 |
BS | backspace | %08 |
HT | horizontal tab | %09 |
LF | line feed | %0A |
VT | vertical tab | %0B |
FF | form feed | %0C |
CR | carriage return | %0D |
SO | shift out | %0E |
SI | shift in | %0F |
DLE | data link escape | %10 |
DC1 | device control 1 | %11 |
DC2 | device control 2 | %12 |
DC3 | device control 3 | %13 |
DC4 | device control 4 | %14 |
NAK | negative acknowledge | %15 |
SYN | synchronize | %16 |
ETB | end transmission block | %17 |
CAN | cancel | %18 |
EM | end of medium | %19 |
SUB | substitute | %1A |
ESC | escape | %1B |
FS | file separator | %1C |
GS | group separator | %1D |
RS | record separator | %1E |
US | unit separator | %1F |
ISO Language Codes
You should always include the lang
attribute inside the <html>
tag, to declare the language of the Web page. This is meant to assist search engines and browsers:<html lang=”en”>
…
</html>
In XHTML, the language is declared inside the <html>
tag as follows:<html xmlns=”http://www.w3.org/1999/xhtml” lang=”en” xml:lang=”en”>
…
</html>
ISO 639-1 Language Codes
ISO 639-1 defines abbreviations for languages:
See also: Reference for Country Codes.
Language | ISO Code |
---|---|
Abkhazian | ab |
Afar | aa |
Afrikaans | af |
Akan | ak |
Albanian | sq |
Amharic | am |
Arabic | ar |
Aragonese | an |
Armenian | hy |
Assamese | as |
Avaric | av |
Avestan | ae |
Aymara | ay |
Azerbaijani | az |
Bambara | bm |
Bashkir | ba |
Basque | eu |
Belarusian | be |
Bengali (Bangla) | bn |
Bihari | bh |
Bislama | bi |
Bosnian | bs |
Breton | br |
Bulgarian | bg |
Burmese | my |
Catalan | ca |
Chamorro | ch |
Chechen | ce |
Chichewa, Chewa, Nyanja | ny |
Chinese | zh |
Chinese (Simplified) | zh-Hans |
Chinese (Traditional) | zh-Hant |
Chuvash | cv |
Cornish | kw |
Corsican | co |
Cree | cr |
Croatian | hr |
Czech | cs |
Danish | da |
Divehi, Dhivehi, Maldivian | dv |
Dutch | nl |
Dzongkha | dz |
English | en |
Esperanto | eo |
Estonian | et |
Ewe | ee |
Faroese | fo |
Fijian | fj |
Finnish | fi |
French | fr |
Fula, Fulah, Pulaar, Pular | ff |
Galician | gl |
Gaelic (Scottish) | gd |
Gaelic (Manx) | gv |
Georgian | ka |
German | de |
Greek | el |
Greenlandic | kl |
Guarani | gn |
Gujarati | gu |
Haitian Creole | ht |
Hausa | ha |
Hebrew | he |
Herero | hz |
Hindi | hi |
Hiri Motu | ho |
Hungarian | hu |
Icelandic | is |
Ido | io |
Igbo | ig |
Indonesian | id, in |
Interlingua | ia |
Interlingue | ie |
Inuktitut | iu |
Inupiak | ik |
Irish | ga |
Italian | it |
Japanese | ja |
Javanese | jv |
Kalaallisut, Greenlandic | kl |
Kannada | kn |
Kanuri | kr |
Kashmiri | ks |
Kazakh | kk |
Khmer | km |
Kikuyu | ki |
Kinyarwanda (Rwanda) | rw |
Kirundi | rn |
Kyrgyz | ky |
Komi | kv |
Kongo | kg |
Korean | ko |
Kurdish | ku |
Kwanyama | kj |
Lao | lo |
Latin | la |
Latvian (Lettish) | lv |
Limburgish ( Limburger) | li |
Lingala | ln |
Lithuanian | lt |
Luga-Katanga | lu |
Luganda, Ganda | lg |
Luxembourgish | lb |
Manx | gv |
Macedonian | mk |
Malagasy | mg |
Malay | ms |
Malayalam | ml |
Maltese | mt |
Maori | mi |
Marathi | mr |
Marshallese | mh |
Moldavian | mo |
Mongolian | mn |
Nauru | na |
Navajo | nv |
Ndonga | ng |
Northern Ndebele | nd |
Nepali | ne |
Norwegian | no |
Norwegian bokmรฅl | nb |
Norwegian nynorsk | nn |
Nuosu | ii |
Occitan | oc |
Ojibwe | oj |
Old Church Slavonic, Old Bulgarian | cu |
Oriya | or |
Oromo (Afaan Oromo) | om |
Ossetian | os |
Pฤli | pi |
Pashto, Pushto | ps |
Persian (Farsi) | fa |
Polish | pl |
Portuguese | pt |
Punjabi (Eastern) | pa |
Quechua | qu |
Romansh | rm |
Romanian | ro |
Russian | ru |
Sami | se |
Samoan | sm |
Sango | sg |
Sanskrit | sa |
Serbian | sr |
Serbo-Croatian | sh |
Sesotho | st |
Setswana | tn |
Shona | sn |
Sichuan Yi | ii |
Sindhi | sd |
Sinhalese | si |
Siswati | ss |
Slovak | sk |
Slovenian | sl |
Somali | so |
Southern Ndebele | nr |
Spanish | es |
Sundanese | su |
Swahili (Kiswahili) | sw |
Swati | ss |
Swedish | sv |
Tagalog | tl |
Tahitian | ty |
Tajik | tg |
Tamil | ta |
Tatar | tt |
Telugu | te |
Thai | th |
Tibetan | bo |
Tigrinya | ti |
Tonga | to |
Tsonga | ts |
Turkish | tr |
Turkmen | tk |
Twi | tw |
Uyghur | ug |
Ukrainian | uk |
Urdu | ur |
Uzbek | uz |
Venda | ve |
Vietnamese | vi |
Volapรผk | vo |
Wallon | wa |
Welsh | cy |
Wolof | wo |
Western Frisian | fy |
Xhosa | xh |
Yiddish | yi, ji |
Yoruba | yo |
Zhuang, Chuang | za |
Zulu | zu |
ISO Country Codes
In HTML, country codes can be used as an addition to the language code in the lang
attribute.
The first two characters of a language code defines the language of the Web page (See Language Code Reference).
The last two characters define the country.
The following example specifies English as language and United States as country:<html lang=”en-US”>
…
</html>
ISO Country Codes
Country | ISO Code |
---|---|
AFGHANISTAN | AF |
ALBANIA | AL |
ALGERIA | DZ |
AMERICAN SAMOA | AS |
ANDORRA | AD |
ANGOLA | AO |
ANTARCTICA | AQ |
ANTIGUA AND BARBUDA | AG |
ARGENTINA | AR |
ARMENIA | AM |
ARUBA | AW |
AUSTRALIA | AU |
AUSTRIA | AT |
AZERBAIJAN | AZ |
BAHAMAS | BS |
BAHRAIN | BH |
BANGLADESH | BD |
BARBADOS | BB |
BELARUS | BY |
BELGIUM | BE |
BELIZE | BZ |
BENIN | BJ |
BERMUDA | BM |
BHUTAN | BT |
BOLIVIA | BO |
BOSNIA AND HERZEGOVINA | BA |
BOTSWANA | BW |
BOUVET ISLAND | BV |
BRAZIL | BR |
BRITISH INDIAN OCEAN TERRITORY | IO |
BRUNEI DARUSSALAM | BN |
BULGARIA | BG |
BURKINA FASO | BF |
BURUNDI | BI |
CAMBODIA | KH |
CAMEROON | CM |
CANADA | CA |
CAPE VERDE | CV |
CAYMAN ISLANDS | KY |
CENTRAL AFRICAN REPUBLIC | CF |
CHAD | TD |
CHILE | CL |
CHINA | CN |
CHRISTMAS ISLAND | CX |
COCOS (KEELING) ISLANDS | CC |
COLOMBIA | CO |
COMOROS | KM |
CONGO | CG |
CONGO, THE DEMOCRATIC REPUBLIC OF THE | CD |
COOK ISLANDS | CK |
COSTA RICA | CR |
CรTE D’IVOIRE | CI |
CROATIA | HR |
CUBA | CU |
CYPRUS | CY |
CZECH REPUBLIC | CZ |
DENMARK | DK |
DJIBOUTI | DJ |
DOMINICA | DM |
DOMINICAN REPUBLIC | DO |
ECUADOR | EC |
EGYPT | EG |
EL SALVADOR | SV |
EQUATORIAL GUINEA | GQ |
ERITREA | ER |
ESTONIA | EE |
ETHIOPIA | ET |
FALKLAND ISLANDS (MALVINAS) | FK |
FAROE ISLANDS | FO |
FIJI | FJ |
FINLAND | FI |
FRANCE | FR |
FRENCH GUIANA | GF |
FRENCH POLYNESIA | PF |
FRENCH SOUTHERN TERRITORIES | TF |
GABON | GA |
GAMBIA | GM |
GEORGIA | GE |
GERMANY | DE |
GHANA | GH |
GIBRALTAR | GI |
GREECE | GR |
GREENLAND | GL |
GRENADA | GD |
GUADELOUPE | GP |
GUAM | GU |
GUATEMALA | GT |
GUINEA | GN |
GUINEA-BISSAU | GW |
GUYANA | GY |
HAITI | HT |
HEARD ISLAND AND MCDONALD ISLANDS | HM |
HONDURAS | HN |
HONG KONG | HK |
HUNGARY | HU |
ICELAND | IS |
INDIA | IN |
INDONESIA | ID |
IRAN, ISLAMIC REPUBLIC OF | IR |
IRAQ | IQ |
IRELAND | IE |
ISRAEL | IL |
ITALY | IT |
JAMAICA | JM |
JAPAN | JP |
JORDAN | JO |
KAZAKHSTAN | KZ |
KENYA | KE |
KIRIBATI | KI |
KOREA, DEMOCRATIC PEOPLE’S REPUBLIC OF | KP |
KOREA, REPUBLIC OF | KR |
KUWAIT | KW |
KYRGYZSTAN | KG |
LAO PEOPLE’S DEMOCRATIC REPUBLIC (LAOS) | LA |
LATVIA | LV |
LEBANON | LB |
LESOTHO | LS |
LIBERIA | LR |
LIBYA, STATE OF | LY |
LIECHTENSTEIN | LI |
LITHUANIA | LT |
LUXEMBOURG | LU |
MACAO | MO |
MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF | MK |
MADAGASCAR | MG |
MALAWI | MW |
MALAYSIA | MY |
MALDIVES | MV |
MALI | ML |
MALTA | MT |
MARSHALL ISLANDS | MH |
MARTINIQUE | MQ |
MAURITANIA | MR |
MAURITIUS | MU |
MAYOTTE | YT |
MEXICO | MX |
MICRONESIA, FEDERATED STATES OF | FM |
MOLDOVA, REPUBLIC OF | MD |
MONACO | MC |
MONGOLIA | MN |
MONTENEGRO | ME |
MONTSERRAT | MS |
MOROCCO | MA |
MOZAMBIQUE | MZ |
MYANMAR | MM |
NAMIBIA | NA |
NAURU | NR |
NEPAL, FEDERAL DEMOCRATIC REPUBLIC OF | NP |
NETHERLANDS | NL |
NETHERLANDS ANTILLES | AN |
NEW CALEDONIA | NC |
NEW ZEALAND | NZ |
NICARAGUA | NI |
NIGER | NE |
NIGERIA | NG |
NIUE | NU |
NORFOLK ISLAND | NF |
NORTHERN MARIANA ISLANDS | MP |
NORWAY | NO |
OMAN | OM |
PAKISTAN | PK |
PALAU | PW |
PALESTINE, STATE OF | PS |
PANAMA | PA |
PAPUA NEW GUINEA | PG |
PARAGUAY | PY |
PERU | PE |
PHILIPPINES | PH |
PITCAIRN | PN |
POLAND | PL |
PORTUGAL | PT |
PUERTO RICO | PR |
QATAR | QA |
RรUNION | RE |
ROMANIA | RO |
RUSSIAN FEDERATION | RU |
RWANDA | RW |
SAINT HELENA | SH |
SAINT KITTS AND NEVIS | KN |
SAINT LUCIA | LC |
SAINT PIERRE AND MIQUELON | PM |
SAINT VINCENT AND THE GRENADINES | VC |
SAMOA | WS |
SAN MARINO | SM |
SAO TOME AND PRINCIPE | ST |
SAUDI ARABIA | SA |
SENEGAL | SN |
SERBIA | RS |
SEYCHELLES | SC |
SIERRA LEONE | SL |
SINGAPORE | SG |
SLOVAKIA | SK |
SLOVENIA | SI |
SOLOMON ISLANDS | SB |
SOMALIA | SO |
SOUTH AFRICA | ZA |
SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS | GS |
SOUTH SUDAN | SS |
SPAIN | ES |
SRI LANKA | LK |
SUDAN | SD |
SURINAME | SR |
SVALBARD AND JAN MAYEN | SJ |
SWAZILAND | SZ |
SWEDEN | SE |
SWITZERLAND | CH |
SYRIAN ARAB REPUBLIC | SY |
TAIWAN | TW |
TAJIKISTAN | TJ |
TANZANIA, UNITED REPUBLIC OF | TZ |
THAILAND | TH |
TIMOR-LESTE | TL |
TOGO | TG |
TOKELAU | TK |
TONGA | TO |
TRINIDAD AND TOBAGO | TT |
TUNISIA | TN |
TURKEY | TR |
TURKMENISTAN | TM |
TURKS AND CAICOS ISLANDS | TC |
TUVALU | TV |
UGANDA | UG |
UKRAINE | UA |
UNITED ARAB EMIRATES | AE |
UNITED KINGDOM | GB |
UNITED STATES | US |
UNITED STATES MINOR OUTLYING ISLANDS | UM |
URUGUAY | UY |
UZBEKISTAN | UZ |
VANUATU | VU |
VENEZUELA | VE |
VIET NAM | VN |
VIRGIN ISLANDS, BRITISH | VG |
VIRGIN ISLANDS, U.S. | VI |
WALLIS AND FUTUNA | WF |
WESTERN SAHARA | EH |
YEMEN | YE |
ZAMBIA | ZM |
ZIMBABWE | ZW |
HTML Error Messages
When a browser requests a service from a web server, an error might occur, and the server might return an error code like “404 Not Found”.
It is common to name these errors HTML error messages.
But these messages are something called HTTP status messages. In fact, the server always returns a message for every request. The most common message is 200 OK.
Below is a list of HTTP status messages that might be returned:
1xx: Information
Message: | Description: |
---|---|
100 Continue | The server has received the request headers, and the client should proceed to send the request body |
101 Switching Protocols | The requester has asked the server to switch protocols |
103 Checkpoint | Used in the resumable requests proposal to resume aborted PUT or POST requests |
2xx: Successful
Message: | Description: |
---|---|
200 OK | The request is OK (this is the standard response for successful HTTP requests) |
201 Created | The request has been fulfilled, and a new resource is created |
202 Accepted | The request has been accepted for processing, but the processing has not been completed |
203 Non-Authoritative Information | The request has been successfully processed, but is returning information that may be from another source |
204 No Content | The request has been successfully processed, but is not returning any content |
205 Reset Content | The request has been successfully processed, but is not returning any content, and requires that the requester reset the document view |
206 Partial Content | The server is delivering only part of the resource due to a range header sent by the client |
3xx: Redirection
Message: | Description: |
---|---|
300 Multiple Choices | A link list. The user can select a link and go to that location. Maximum five addresses |
301 Moved Permanently | The requested page has moved to a new URL |
302 Found | The requested page has moved temporarily to a new URL |
303 See Other | The requested page can be found under a different URL |
304 Not Modified | Indicates the requested page has not been modified since last requested |
306 Switch Proxy | No longer used |
307 Temporary Redirect | The requested page has moved temporarily to a new URL |
308 Resume Incomplete | Used in the resumable requests proposal to resume aborted PUT or POST requests |
4xx: Client Error
Message: | Description: |
---|---|
400 Bad Request | The request cannot be fulfilled due to bad syntax |
401 Unauthorized | The request was a legal request, but the server is refusing to respond to it. For use when authentication is possible but has failed or not yet been provided |
402 Payment Required | Reserved for future use |
403 Forbidden | The request was a legal request, but the server is refusing to respond to it |
404 Not Found | The requested page could not be found but may be available again in the future |
405 Method Not Allowed | A request was made of a page using a request method not supported by that page |
406 Not Acceptable | The server can only generate a response that is not accepted by the client |
407 Proxy Authentication Required | The client must first authenticate itself with the proxy |
408 Request Timeout | The server timed out waiting for the request |
409 Conflict | The request could not be completed because of a conflict in the request |
410 Gone | The requested page is no longer available |
411 Length Required | The “Content-Length” is not defined. The server will not accept the request without it |
412 Precondition Failed | The precondition given in the request evaluated to false by the server |
413 Request Entity Too Large | The server will not accept the request, because the request entity is too large |
414 Request-URI Too Long | The server will not accept the request, because the URL is too long. Occurs when you convert a POST request to a GET request with a long query information |
415 Unsupported Media Type | The server will not accept the request, because the media type is not supported |
416 Requested Range Not Satisfiable | The client has asked for a portion of the file, but the server cannot supply that portion |
417 Expectation Failed | The server cannot meet the requirements of the Expect request-header field |
5xx: Server Error
Message: | Description: |
---|---|
500 Internal Server Error | A generic error message, given when no more specific message is suitable |
501 Not Implemented | The server either does not recognize the request method, or it lacks the ability to fulfill the request |
502 Bad Gateway | The server was acting as a gateway or proxy and received an invalid response from the upstream server |
503 Service Unavailable | The server is currently unavailable (overloaded or down) |
504 Gateway Timeout | The server was acting as a gateway or proxy and did not receive a timely response from the upstream server |
505 HTTP Version Not Supported | The server does not support the HTTP protocol version used in the request |
511 Network Authentication Required | The client needs to authenticate to gain network access |
HTML Error Messages
When a browser requests a service from a web server, an error might occur, and the server might return an error code like “404 Not Found”.
It is common to name these errors HTML error messages.
But these messages are something called HTTP status messages. In fact, the server always returns a message for every request. The most common message is 200 OK.
Below is a list of HTTP status messages that might be returned:
1xx: Information
Message: | Description: |
---|---|
100 Continue | The server has received the request headers, and the client should proceed to send the request body |
101 Switching Protocols | The requester has asked the server to switch protocols |
103 Checkpoint | Used in the resumable requests proposal to resume aborted PUT or POST requests |
2xx: Successful
Message: | Description: |
---|---|
200 OK | The request is OK (this is the standard response for successful HTTP requests) |
201 Created | The request has been fulfilled, and a new resource is created |
202 Accepted | The request has been accepted for processing, but the processing has not been completed |
203 Non-Authoritative Information | The request has been successfully processed, but is returning information that may be from another source |
204 No Content | The request has been successfully processed, but is not returning any content |
205 Reset Content | The request has been successfully processed, but is not returning any content, and requires that the requester reset the document view |
206 Partial Content | The server is delivering only part of the resource due to a range header sent by the client |
3xx: Redirection
Message: | Description: |
---|---|
300 Multiple Choices | A link list. The user can select a link and go to that location. Maximum five addresses |
301 Moved Permanently | The requested page has moved to a new URL |
302 Found | The requested page has moved temporarily to a new URL |
303 See Other | The requested page can be found under a different URL |
304 Not Modified | Indicates the requested page has not been modified since last requested |
306 Switch Proxy | No longer used |
307 Temporary Redirect | The requested page has moved temporarily to a new URL |
308 Resume Incomplete | Used in the resumable requests proposal to resume aborted PUT or POST requests |
4xx: Client Error
Message: | Description: |
---|---|
400 Bad Request | The request cannot be fulfilled due to bad syntax |
401 Unauthorized | The request was a legal request, but the server is refusing to respond to it. For use when authentication is possible but has failed or not yet been provided |
402 Payment Required | Reserved for future use |
403 Forbidden | The request was a legal request, but the server is refusing to respond to it |
404 Not Found | The requested page could not be found but may be available again in the future |
405 Method Not Allowed | A request was made of a page using a request method not supported by that page |
406 Not Acceptable | The server can only generate a response that is not accepted by the client |
407 Proxy Authentication Required | The client must first authenticate itself with the proxy |
408 Request Timeout | The server timed out waiting for the request |
409 Conflict | The request could not be completed because of a conflict in the request |
410 Gone | The requested page is no longer available |
411 Length Required | The “Content-Length” is not defined. The server will not accept the request without it |
412 Precondition Failed | The precondition given in the request evaluated to false by the server |
413 Request Entity Too Large | The server will not accept the request, because the request entity is too large |
414 Request-URI Too Long | The server will not accept the request, because the URL is too long. Occurs when you convert a POST request to a GET request with a long query information |
415 Unsupported Media Type | The server will not accept the request, because the media type is not supported |
416 Requested Range Not Satisfiable | The client has asked for a portion of the file, but the server cannot supply that portion |
417 Expectation Failed | The server cannot meet the requirements of the Expect request-header field |
5xx: Server Error
Message: | Description: |
---|---|
500 Internal Server Error | A generic error message, given when no more specific message is suitable |
501 Not Implemented | The server either does not recognize the request method, or it lacks the ability to fulfill the request |
502 Bad Gateway | The server was acting as a gateway or proxy and received an invalid response from the upstream server |
503 Service Unavailable | The server is currently unavailable (overloaded or down) |
504 Gateway Timeout | The server was acting as a gateway or proxy and did not receive a timely response from the upstream server |
505 HTTP Version Not Supported | The server does not support the HTTP protocol version used in the request |
511 Network Authentication Required | The client needs to authenticate to gain network access |
Pixel to Em Converter
The tool below allows you to work out the em sizes from pixels (or vice versa).
- Set a default pixel size for body (usually 16px)
- Then, convert a pixel value to em, based on the default pixel size
- Or, convert an em value to pixels, based on the default pixel size
Set a default pixel size: px
Convert PX to EM:
px
Convert EM to PX:
ย em
Body Font Size
In the table below, select a body font size in pixels (px) to display a complete “px to em and percent” conversion table.
Tip: The default font size is usually 16px.
px | em | percent |
---|---|---|
5px | 0.3125em | 31.25% |
6px | 0.3750em | 37.50% |
7px | 0.4375em | 43.75% |
8px | 0.5000em | 50.00% |
9px | 0.5625em | 56.25% |
10px | 0.6250em | 62.50% |
11px | 0.6875em | 68.75% |
12px | 0.7500em | 75.00% |
13px | 0.8125em | 81.25% |
14px | 0.8750em | 87.50% |
15px | 0.9375em | 93.75% |
16px | 1.0000em | 100.00% |
17px | 1.0625em | 106.25% |
18px | 1.1250em | 112.50% |
19px | 1.1875em | 118.75% |
20px | 1.2500em | 125.00% |
21px | 1.3125em | 131.25% |
22px | 1.3750em | 137.50% |
23px | 1.4375em | 143.75% |
24px | 1.5000em | 150.00% |
25px | 1.5625em | 156.25% |
What is the difference between PX, EM and Percent?
Pixel is a static measurement, while percent and EM are relative measurements. The size of an EM or percent depends on its parent. If the text size of body is 16 pixels, then 150% or 1.5 EM will be 24 pixels (1.5 * 16). Look atย CSS Unitsย for more measurement units.
Keyboard Shortcuts For Windows and Mac
Keyboard shortcuts are often used in modern operating systems and computer software programs.
Learning and using keyboard shortcuts can save you a lot of time.
Basic Shortcuts
Description | Windows | Mac OS |
---|---|---|
Edit menu | Alt + E | Ctrl + F2 + F |
File menu | Alt + F | Ctrl + F2 + E |
View menu | Alt + V | Ctrl + F2 + V |
Select all text | Ctrl + A | Cmd + A |
Copy text | Ctrl + C | Cmd + C |
Find text | Ctrl + F | Cmd + F |
Find and replace text | Ctrl + H | Cmd + F |
New Document | Ctrl + N | Cmd + N |
Open a file | Ctrl + O | Cmd + O |
Print options | Ctrl + P | Cmd + P |
Save file | Ctrl + S | Cmd + S |
Paste text | Ctrl + V | Cmd + V |
Cut text | Ctrl + X | Cmd + X |
Redo text | Ctrl + Y | Shift + Cmd + Z |
Undo text | Ctrl + Z | Cmd + Z |
Text Editing
Description | Windows | Mac OS |
---|---|---|
Cursor Movement | ||
Go to the right or to the beginning of next line break | Right Arrow | Right Arrow |
Go to the left or to the end of previous line break | Left Arrow | Left Arrow |
Go up one row | Up Arrow | Up Arrow |
Go down one row | Down Arrow | Down Arrow |
Go to the beginning of the current line | Home | Cmd + Left Arrow |
Go to the end of the current line | End | Cmd + Right Arrow |
Go to the beginning of the document | Ctrl + Home | Cmd + Up Arrow |
Go to the end of the document | Ctrl + End | Cmd + Down Arrow |
Move up one frame | Page Up | Fn + Up Arrow |
Move down one frame | Page Down | Fn + Down Arrow |
Go to beginning of previous word | Ctrl + Left Arrow | Option + Left Arrow |
Go to beginning of next word | Ctrl + Right Arrow | Option + Right Arrow |
Go to beginning of line break | Ctrl + Up Arrow | Cmd + Left Arrow |
Go to end of line break | Ctrl + Down Arrow | Cmd + Right Arrow |
Text Selection | ||
Select characters to the left | Shift + Left Arrow | Shift + Left Arrow |
Select characters to the right | Shift + Right Arrow | Shift + Right Arrow |
Select lines upwards | Shift + Up Arrow | Shift + Up Arrow |
Select lines downwards | Shift + Down Arrow | Shift + Down Arrow |
Select words to the left | Shift + Ctrl + Left | Shift + Opt + Left |
Select words to the right | Shift + Ctrl + Right | Shift + Opt + Right |
Select paragraphs to the left | Shift + Ctrl + Up | Shift + Opt + Up |
Select paragraphs to the right | Shift + Ctrl + Down | Shift + Opt + Down |
Select text between the cursor and the beginning of the current line | Shift + Home | Cmd + Shift + Left Arrow |
Select text between the cursor and the end of the current line | Shift + End | Cmd + Shift + Right Arrow |
Select text between the cursor and the beginning of the document | Shift + Ctrl + Home | Cmd + Shift + Up Arrow or Cmd + Shift + Fn + Left Arrow |
Select text between the cursor and the end of the document | Shift + Ctrl + End | Cmd + Shift + Down Arrow or Cmd + Shift + Fn + Right Arrow |
Select one frame at a time of text above the cursor | Shift + Page Up | Shift + Fn + Up Arrow |
Select one frame at a time of text below the cursor | Shift + Page Down | Shift + Fn + Down Arrow |
Select all text | Ctrl + A | Cmd + A |
Find text | Ctrl + F | Cmd + F |
Text Formatting | ||
Make selected text bold | Ctrl + B | Cmd + B |
Make selected text italic | Ctrl + I | Cmd + I |
Underline selected text | Ctrl + U | Cmd + U |
Make selected text superscript | Ctrl + Shift + = | Cmd + Shift + = |
Make selected text subscript | Ctrl + = | Cmd + = |
Text Editing | ||
Delete characters to the left | Backspace | Backspace |
Delete characters to the right | Delete | Fn + Backspace |
Delete words to the right | Ctrl + Del | Cmd + Backspace |
Delete words to the left | Ctrl + Backspace | Cmd + Fn + Backspace |
Indent | Tab | Tab |
Outdent | Shift + Tab | Shift + Tab |
Copy text | Ctrl + C | Cmd + C |
Find and replace text | Ctrl + H | Cmd + F |
Paste text | Ctrl + V | Cmd + V |
Cut text | Ctrl + X | Cmd + X |
Redo text | Ctrl + Y | Shift + Cmd + Z |
Undo text | Ctrl + Z | Cmd + Z |
Web Browsers
Description | Windows | Mac OS |
---|---|---|
Navigation | ||
Scroll down a frame | Space or Page Down | Space or Fn + Down Arrow |
Scroll up a frame | Shift + Space or Page Up | Shift + Space or Fn + Up Arrow |
Go to bottom of the page | End | Cmd + Down Arrow |
Go to top of the page | Home | Cmd + Up Arrow |
Go back | Alt + Left Arrow or Backspace | Cmd + Left Arrow |
Go forward | Alt + Right Arrow or Shift + Backspace | Cmd + Right Arrow |
Refresh a webpage | F5 | Cmd + R |
Refresh a webpage (no cache) | Ctrl + F5 | Cmd + Shift + R |
Stop | Esc | Esc |
Toggle full-screen | F11 | Cmd + Shift + F |
Zoom in | Ctrl + + | Cmd + + |
Zoom out | Ctrl + – | Cmd + – |
Zoom 100% (default) | Ctrl + 0 | Cmd + 0 |
Open homepage | Alt + Home | Option + Home or Option + Fn + Left Arrow |
Find text | Ctrl + F | Cmd + F |
Tab / Window Management | ||
Open a new tab | Ctrl + T | Cmd + T |
Close current tab | Ctrl + W | Cmd + W |
Close all tabs | Ctrl + Shift + W | Cmd + Q |
Close all tabs except the current tab | Ctrl + Alt + F4 | Cmd + Opt + W |
Go to next tab | Ctrl + Tab | Control + Tab or Cmd + Shift + Right Arrow |
Go to previous tab | Ctrl + Shift + Tab | Shift + Control + Tab or Cmd + Shift + Left Arrow |
Go to a specific tab number | Ctrl + 1-8 | Cmd + 1-8 |
Go to the last tab | Ctrl + 9 | Cmd + 9 |
Reopen the last closed tab | Ctrl + Shift + T | Cmd + Shift + T |
Open a new window | Ctrl + N | Cmd + N |
Close current window | Alt + F4 | Cmd + W |
Go to next window | Alt + Tab | Cmd + Tab |
Go to previous window | Alt + Shift + Tab | Cmd + Shift + Tab |
Reopen the last closed window | Ctrl + Shift + N | |
Open links in a new tab in the background | Ctrl + Click | Cmd + Click |
Open links in a new tab in the foreground | Ctrl + Shift + Click | Cmd + Shift + Click |
Print current webpage | Ctrl + P | Cmd + P |
Save current webpage | Ctrl + S | Cmd + S |
Address Bar | ||
Cycle between toolbar, search bar, and page elements | Tab | Tab |
Go to browser’s address bar | Ctrl + L or Alt + D | Cmd + L |
Focus and select the browser’s search bar | Ctrl + E | Cmd + E / Cmd + K |
Open the address bar location in a new tab | Alt + Enter | Opt + Enter |
Display a list of previously typed addresses | F4 | |
Add “www.” to the beginning and “.com” to the end of the text typed in the address bar (e.g., type “w3schools” and press Ctrl + Enter to open “www.w3schools.com”) | Ctrl + Enter | Cmd + Enter or Control + Enter |
Bookmarks | ||
Open the bookmarks menu | Ctrl + B | Cmd + B |
Add bookmark for current page | Ctrl + D | Cmd + Opt + B or Cmd + Shift + B |
Open browsing history | Ctrl + H | Cmd + Shift + H or Cmd + Y |
Open download history | Ctrl + J | Cmd + J or Cmd + Shift + J |
Screenshots
Description | Windows | Mac OS |
---|---|---|
Save screenshot of the whole screen as file | Cmd + Shift + 3 | |
Copy screenshot of the whole screen to the clipboard | PrtScr (Print Screen) or Ctrl + PrtScr | Cmd + Ctrl + Shift + 3 |
Save screenshot of window as file | Cmd + Shift + 4, then Space | |
Copy screenshot of window to the clipboard | Alt + PrtScr | Cmd + Ctrl + Shift + 4, then Space |
Copy screenshot of wanted area to the clipboard | Cmd + Ctrl + Shift + 4 | |
Save screenshot of wanted area as file | Cmd + Shift + 4 |