کاربر:Zaman/صفحه تمرین1

از ویکی‌کد، دانشنامهٔ برنامه‌نویسی
پرش به ناوبری پرش به جستجو


////////////////////////////////////////


HTML Element Reference

❮ HomeNext ❯


HTML Tags Ordered Alphabetically

Tag توضیحات
نظر را تعریف می کند
<!DOCTYPE> نوع سند را تعریف می کند
<a> پیوند را تعریف می کند
<abbr> مخفف اختصاری یا مخفف را تعریف می کند
<acronym> در HTML5 پشتیبانی نمی شود. به جای آن از <abbr> استفاده کنید.

کلمه اختصاری را تعریف می کند

<address> اطلاعات تماس را برای نویسنده / صاحب یک سند تعریف می کند
<applet> در HTML5 پشتیبانی نمی شود. به جای آن از <embed> یا <object> استفاده کنید.

اپلت تعبیه شده را تعریف می کند

<area> منطقه ای را در داخل نقشه تصویر تعریف می کند
<article> مقاله ای را تعریف می کند
<aside> محتوا را جدا از محتوای صفحه تعریف می کند
<audio> محتوای صدا را تعریف می کند
<b> متن جسورانه را تعریف می کند
<base> URL / هدف اصلی برای کلیه URL های نسبی در یک سند را مشخص می کند
<basefont> در HTML5 پشتیبانی نمی شود. به جای آن از CSS استفاده کنید

یک رنگ ، اندازه و فونت پیش فرض برای همه متن های یک سند را مشخص می کند

<bdi> بخشی از متن را که ممکن است در جهت دیگری با متن دیگر در خارج از آن فرمت شود ، جدا می کند
<bdo> جهت متن فعلی را نادیده می گیرد
<big> در HTML5 پشتیبانی نمی شود. به جای آن از CSS استفاده کنید

متن بزرگ را تعریف می کند

<blockquote> بخشی را تعریف می کند که از منبع دیگری نقل شده است
<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> Links the given content with a machine-readable translation
<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> Represents the defining instance of a term
<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 (non-HTML) 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> Defines information about 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 a client-side 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 an embedded object
<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 template
<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 date/time
<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 text that should be stylistically different from normal text
<ul> Defines an unordered list
<var> Defines a variable
<video> Defines a video or movie
<wbr> Defines a possible line-break


❮ HomeNext ❯

////////////////////////////////////////


HTML Element Reference - By Category

❮ PreviousNext ❯


Basic HTML

Tag Description
<!DOCTYPE> Defines the document type
<html> Defines an HTML document
<head> Defines information about 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> Represents the defining instance of a term
<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 template
<time> Defines a date/time
<tt> Not supported in HTML5. Use CSS instead.

Defines teletype text

<u> Defines text that should be stylistically different 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> Links the given content with a machine-readable translation

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


❮ PreviousNext ❯

////////////////////////////////////////


HTML Reference - Browser Support

❮ PreviousNext ❯


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


<base> Yes Yes Yes Yes Yes
href Yes Yes Yes Yes Yes
target Yes Yes Yes Yes Yes


<bdi> 16.0 79.0 10.0 No 15.0


<bdo> Yes Yes Yes Yes Yes
dir Yes Yes Yes Yes Yes


<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


<canvas> 4.0 9.0 2.0 3.1 9.0
height 4.0 9.0 2.0 3.1 9.0
width 4.0 9.0 2.0 3.1 9.0


<caption> Yes Yes Yes Yes Yes


<cite> Yes Yes Yes Yes Yes


<code> Yes Yes Yes Yes Yes


<col> Yes Yes Yes Yes Yes
span 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


<del> Yes Yes Yes Yes Yes
cite Yes Yes Yes Yes Yes
datetime Yes Yes Yes Yes Yes


<details> 12.0 79.0 49.0 6.0 15.0
open 12.0 79.0 49.0 6.0 15.0


<dfn> Yes Yes Yes Yes Yes


<dialog> 37.0 79.0 53.0* No 24.0
open 37.0 79.0 53.0* No 24.0

* 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
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


<html> Yes Yes Yes Yes Yes
xmlns 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
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


<ins> Yes Yes Yes Yes Yes
cite Yes Yes Yes Yes Yes
datetime Yes Yes Yes Yes Yes


<kbd> Yes Yes Yes Yes Yes


<label> Yes Yes Yes Yes Yes
for Yes Yes Yes Yes Yes
form Yes Yes Yes Yes Yes


<legend> Yes Yes Yes Yes Yes


<li> Yes Yes Yes Yes Yes
value 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


<map> Yes Yes Yes Yes Yes
name Yes Yes Yes Yes Yes


<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


<ol> Yes Yes Yes Yes Yes
reversed 18.0 79.0 18.0 6.0 12.1
start Yes Yes Yes Yes Yes
type 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


<output> 10.0 13.0 4.0 5.1 11.0
for 10.0 13.0 4.0 7.0 11.5
form No No No No No
name 10.0 13.0 4.0 7.0 11.5


<p> Yes Yes Yes Yes Yes


<param> Yes Yes Yes Yes Yes
name Yes Yes Yes Yes Yes
value 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


<q> Yes Yes Yes Yes Yes
cite Yes Yes Yes Yes Yes


<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


<style> Yes Yes Yes Yes Yes
media Yes Yes Yes Yes Yes
type 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


<td> Yes Yes Yes Yes Yes
colspan Yes Yes Yes Yes Yes
headers Yes Yes Yes Yes Yes
rowspan 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


<time> 62.0 18.0 22.0 7.0 49.0
datetime 62.0 18.0 22.0 7.0 49.0


<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


❮ PreviousNext ❯

////////////////////////////////////////


HTML Attribute Reference

❮ PreviousNext ❯


All HTML Attributes

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
dropzone Global Attributes Specifies whether the dragged data is copied, moved, or linked, when dropped
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>, <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


❮ PreviousNext ❯

////////////////////////////////////////


HTML Global Attributes

❮ PreviousNext ❯


HTML attributes give elements meaning and context.

The global attributes below can be used on any HTML element.


HTML Global Attributes

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
dropzone Specifies whether the dragged data is copied, moved, or linked, when dropped
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


❮ PreviousNext ❯

////////////////////////////////////////


HTML Event Attributes

❮ PreviousNext ❯


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


❮ PreviousNext ❯

////////////////////////////////////////


HTML Color Names

❮ PreviousNext ❯


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


❮ PreviousNext ❯

////////////////////////////////////////


HTML Canvas Reference

❮ PreviousNext ❯


Description

The HTML <canvas> tag is used to draw graphics, on the fly, via scripting (usually JavaScript).

However, the <canvas> element has no drawing abilities of its own (it is only a container for graphics) - you must use a script to actually draw the graphics.

The getContext() method returns an object that provides methods and properties for drawing on the canvas.

This reference will cover the properties and methods of the getContext("2d") object, which can be used to draw text, lines, boxes, circles, and more - on the canvas.


Browser Support

The numbers in the table specify the first browser version that fully supports the element.

Element
<canvas> 4.0 9.0 2.0 3.1 9.0

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()


❮ PreviousNext ❯

////////////////////////////////////////


HTML Audio/Video DOM Reference

❮ PreviousNext ❯


HTML Audio and Video DOM Reference

The HTML5 DOM has methods, properties, and events for the <audio> and <video> elements.

These methods, properties, and events allow you to manipulate <audio> and <video> elements using JavaScript.


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


❮ PreviousNext ❯

///////////////////////////////////////


HTML Character Sets

❮ PreviousNext ❯


Common HTML Character Sets

ANSI was the first official default character set in Windows.

The default character set in HTML 4 was 8859-1.

The default character set in HTML 5 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


❮ PreviousNext ❯