HTML Element Reference

html
ContextsAs document's document element.
Wherever a subdocument fragment is allowed in a compound document.
OmissionsAn html element's start tag can be omitted if the first thing inside the html element is not a comment.
An html element's end tag can be omitted if the html element is not immediately followed by a comment.
AttributesGlobal attributes
The html element represents the root of an HTML document.
title
ContextsIn a head element containing no other title elements.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
The title element represents the document's title or name. Authors should use titles that identify their documents even when they are used out of context, for example in a user's history or bookmarks, or in search results. The document's title is often different from its first heading, since the first heading does not have to stand alone when taken out of context.
base
ContextsIn a head element containing no other base elements.
OmissionsNo end tag.
AttributesGlobal attributes
hrefDocument base URL
target — Default navigable for hyperlink navigation and form submission
The base element allows authors to specify the document base URL for the purposes of parsing URLs, and the name of the default navigable for the purposes of following hyperlinks. The element does not represent any content beyond this information.
meta
ContextsIf the charset attribute is present, or if the element's http-equiv attribute is in the Encoding declaration state: in a head element.
If the http-equiv attribute is present but not in the Encoding declaration state: in a head element.
If the http-equiv attribute is present but not in the Encoding declaration state: in a noscript element that is a child of a head element.
If the name attribute is present: where metadata content is expected.
If the itemprop attribute is present: where metadata content is expected.
If the itemprop attribute is present: where phrasing content is expected.
OmissionsNo end tag.
AttributesGlobal attributes
name — Metadata name
http-equiv — Pragma directive
content — Value of the element
charsetCharacter encoding declaration
media — Applicable media
The meta element represents various kinds of metadata that cannot be expressed using the title, base, link, style, and script elements.
style
ContextsWhere metadata content is expected.
In a noscript element that is a child of a head element.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
media — Applicable media
blocking — Whether the element is potentially render-blocking
Also, the title attribute has special semantics on this element: CSS style sheet set name.
The style element allows authors to embed CSS style sheets in their documents. The style element is one of several inputs to the styling processing model. The element does not represent content for the user.
body
ContextsAs the second element in an html element.
OmissionsA body element's start tag can be omitted if the element is empty, or if the first thing inside the body element is not ASCII whitespace or a comment, except if the first thing inside the body element is a meta, noscript, link, script, style, or template element.
A body element's end tag can be omitted if the body element is not immediately followed by a comment.
AttributesGlobal attributes
onafterprint
onbeforeprint
onbeforeunload
onhashchange
onlanguagechange
onmessage
onmessageerror
onoffline
ononline
onpagehide
onpageshow
onpopstate
onrejectionhandled
onstorage
onunhandledrejection
onunload
The body element represents the contents of the document.
article
ContextsWhere sectioning content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
The article element represents a complete, or self-contained, composition in a document, page, application, or site and that is, in principle, independently distributable or reusable, e.g. in syndication. This could be a forum post, a magazine or newspaper article, a blog entry, a user-submitted comment, an interactive widget or gadget, or any other independent item of content.
section
ContextsWhere sectioning content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
The section element represents a generic section of a document or application. A section, in this context, is a thematic grouping of content, typically with a heading.
aside
ContextsWhere sectioning content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
The aside element represents a section of a page that consists of content that is tangentially related to the content around the aside element, and which could be considered separate from that content. Such sections are often represented as sidebars in printed typography.
h1
ContextsAs a child of an hgroup element.
Where heading content is expected.
Omissions
AttributesGlobal attributes
These elements represent headings for their sections.
hgroup
ContextsWhere heading content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
The hgroup element represents a heading and related content. The element may be used to group an h1h6 element with one or more p elements containing content representing a subheading, alternative title, or tagline.
address
ContextsWhere flow content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
The address element represents the contact information for its nearest article or body element ancestor. If that is the body element, then the contact information applies to the document as a whole.
p
ContextsWhere flow content is expected.
OmissionsA p element's end tag can be omitted if the p element is immediately followed by an address, article, aside, blockquote, details, div, dl, fieldset, figcaption, figure, footer, form, h1, h2, h3, h4, h5, h6, header, hgroup, hr, main, menu, nav, ol, p, pre, section, table, or ul element, or if there is no more content in the parent element and the parent element is an HTML element that is not an a, audio, del, ins, map, noscript, or video element, or an autonomous custom element.
AttributesGlobal attributes
The p element represents a paragraph.
hr
ContextsWhere flow content is expected.
OmissionsNo end tag.
AttributesGlobal attributes
The hr element represents a paragraph-level thematic break, e.g. a scene change in a story, or a transition to another topic within a section of a reference book.
pre
ContextsWhere flow content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
The pre element represents a block of preformatted text, in which structure is represented by typographic conventions rather than by elements.
blockquote
ContextsWhere flow content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
cite — Link to the source of the quotation or more information about the edit
The blockquote element represents a section that is quoted from another source.
ol
ContextsWhere flow content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
reversed — Number the list backwards
startStarting value of the list
type — Kind of list marker
The ol element represents a list of items, where the items have been intentionally ordered, such that changing the order would change the meaning of the document.
ul
ContextsWhere flow content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
The ul element represents a list of items, where the order of the items is not important — that is, where changing the order would not materially change the meaning of the document.
li
ContextsInside ol elements.
Inside ul elements.
Inside menu elements.
OmissionsAn li element's end tag can be omitted if the li element is immediately followed by another li element or if there is no more content in the parent element.
AttributesGlobal attributes
If the element is not a child of an ul or menu element: valueOrdinal value of the list item
The li element represents a list item. If its parent element is an ol, ul, or menu element, then the element is an item of the parent element's list, as defined for those elements. Otherwise, the list item has no defined list-related relationship to any other li element.
dl
ContextsWhere flow content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
The dl element represents an association list consisting of zero or more name-value groups (a description list). A name-value group consists of one or more names (dt elements, possibly as children of a div element child) followed by one or more values (dd elements, possibly as children of a div element child), ignoring any nodes other than dt and dd element children, and dt and dd elements that are children of div element children. Within a single dl element, there should not be more than one dt element for each name.
dt
ContextsBefore dd or dt elements inside dl elements.
Before dd or dt elements inside div elements that are children of a dl element.
OmissionsA dt element's end tag can be omitted if the dt element is immediately followed by another dt element or a dd element.
AttributesGlobal attributes
The dt element represents the term, or name, part of a term-description group in a description list (dl element).
dd
ContextsAfter dt or dd elements inside dl elements.
After dt or dd elements inside div elements that are children of a dl element.
OmissionsA dd element's end tag can be omitted if the dd element is immediately followed by another dd element or a dt element, or if there is no more content in the parent element.
AttributesGlobal attributes
The dd element represents the description, definition, or value, part of a term-description group in a description list (dl element).
figure
ContextsWhere flow content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
The figure element represents some flow content, optionally with a caption, that is self-contained (like a complete sentence) and is typically referenced as a single unit from the main flow of the document.
figcaption
ContextsAs the first or last child of a figure element.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
The figcaption element represents a caption or legend for the rest of the contents of the figcaption element's parent figure element, if any.
main
ContextsWhere flow content is expected, but only if it is a hierarchically correct main element.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
The main element represents the dominant contents of the document.
div
ContextsWhere flow content is expected.
As a child of a dl element.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
The div element has no special meaning at all. It represents its children. It can be used with the class, lang, and title attributes to mark up semantics common to a group of consecutive elements. It can also be used in a dl element, wrapping groups of dt and dd elements.
a
Contexts
Omissions
Attributes
em
ContextsWhere phrasing content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
The em element represents stress emphasis of its contents.
strong
ContextsWhere phrasing content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
The strong element represents strong importance, seriousness, or urgency for its contents.
small
ContextsWhere phrasing content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
The small element represents side comments such as small print.
s
ContextsWhere phrasing content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
The s element represents contents that are no longer accurate or no longer relevant.
cite
ContextsWhere phrasing content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
The cite element represents the title of a work (e.g. a book, a paper, an essay, a poem, a score, a song, a script, a film, a TV show, a game, a sculpture, a painting, a theatre production, a play, an opera, a musical, an exhibition, a legal case report, a computer program, etc.). This can be a work that is being quoted or referenced in detail (i.e., a citation), or it can just be a work that is mentioned in passing.
q
ContextsWhere phrasing content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
cite — Link to the source of the quotation or more information about the edit
The q element represents some phrasing content quoted from another source.
dfn
ContextsWhere phrasing content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
Also, the title attribute has special semantics on this element: Full term or expansion of abbreviation.
The dfn element represents the defining instance of a term. The paragraph, description list group, or section that is the nearest ancestor of the dfn element must also contain the definition(s) for the term given by the dfn element.
abbr
ContextsWhere phrasing content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
Also, the title attribute has special semantics on this element: Full term or expansion of abbreviation.
The abbr element represents an abbreviation or acronym, optionally with its expansion. The title attribute may be used to provide an expansion of the abbreviation. The attribute, if specified, must contain an expansion of the abbreviation, and nothing else.
ruby
ContextsWhere phrasing content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
The ruby element allows one or more spans of phrasing content to be marked with ruby annotations. Ruby annotations are short runs of text presented alongside base text, primarily used in East Asian typography as a guide for pronunciation or to include other annotations. In Japanese, this form of typography is also known as furigana.
rt
ContextsAs a child of a ruby element.
OmissionsAn rt element's end tag can be omitted if the rt element is immediately followed by an rt or rp element, or if there is no more content in the parent element.
AttributesGlobal attributes
The rt element marks the ruby text component of a ruby annotation. When it is the child of a ruby element, it doesn't represent anything itself, but the ruby element uses it as part of determining what it represents.
rp
ContextsAs a child of a ruby element, either immediately before or immediately after an rt element.
OmissionsAn rp element's end tag can be omitted if the rp element is immediately followed by an rt or rp element, or if there is no more content in the parent element.
AttributesGlobal attributes
The rp element can be used to provide parentheses or other content around a ruby text component of a ruby annotation, to be shown by user agents that don't support ruby annotations.
data
ContextsWhere phrasing content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
value — Machine-readable value
The data element represents its contents, along with a machine-readable form of those contents in the value attribute.
time
ContextsWhere phrasing content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
datetime — Machine-readable value
The time element represents its contents, along with a machine-readable form of those contents in the datetime attribute. The kind of content is limited to various kinds of dates, times, time-zone offsets, and durations, as described below.
code
ContextsWhere phrasing content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
The code element represents a fragment of computer code. This could be an XML element name, a filename, a computer program, or any other string that a computer would recognize.
var
ContextsWhere phrasing content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
The var element represents a variable. This could be an actual variable in a mathematical expression or programming context, an identifier representing a constant, a symbol identifying a physical quantity, a function parameter, or just be a term used as a placeholder in prose.
samp
ContextsWhere phrasing content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
The samp element represents sample or quoted output from another program or computing system.
kbd
ContextsWhere phrasing content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
The kbd element represents user input (typically keyboard input, although it may also be used to represent other input, such as voice commands).
sub
ContextsWhere phrasing content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
The sup element represents a superscript and the sub element represents a subscript.
i
ContextsWhere phrasing content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
The i element represents a span of text in an alternate voice or mood, or otherwise offset from the normal prose in a manner indicating a different quality of text, such as a taxonomic designation, a technical term, an idiomatic phrase from another language, transliteration, a thought, or a ship name in Western texts.
b
ContextsWhere phrasing content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
The b element represents a span of text to which attention is being drawn for utilitarian purposes without conveying any extra importance and with no implication of an alternate voice or mood, such as key words in a document abstract, product names in a review, actionable words in interactive text-driven software, or an article lede.
u
ContextsWhere phrasing content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
The u element represents a span of text with an unarticulated, though explicitly rendered, non-textual annotation, such as labeling the text as being a proper name in Chinese text (a Chinese proper name mark), or labeling the text as being misspelt.
mark
ContextsWhere phrasing content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
The mark element represents a run of text in one document marked or highlighted for reference purposes, due to its relevance in another context. When used in a quotation or other block of text referred to from the prose, it indicates a highlight that was not originally present but which has been added to bring the reader's attention to a part of the text that might not have been considered important by the original author when the block was originally written, but which is now under previously unexpected scrutiny. When used in the main prose of a document, it indicates a part of the document that has been highlighted due to its likely relevance to the user's current activity.
bdi
ContextsWhere phrasing content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
Also, the dir global attribute has special semantics on this element.
The bdi element represents a span of text that is to be isolated from its surroundings for the purposes of bidirectional text formatting. [BIDI]
bdo
ContextsWhere phrasing content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
Also, the dir global attribute has special semantics on this element.
The bdo element represents explicit text directionality formatting control for its children. It allows authors to override the Unicode bidirectional algorithm by explicitly specifying a direction override. [BIDI]
span
ContextsWhere phrasing content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
The span element doesn't mean anything on its own, but can be useful when used together with the global attributes, e.g. class, lang, or dir. It represents its children.
br
ContextsWhere phrasing content is expected.
OmissionsNo end tag.
AttributesGlobal attributes
The br element represents a line break.
wbr
ContextsWhere phrasing content is expected.
OmissionsNo end tag.
AttributesGlobal attributes
The wbr element represents a line break opportunity.
ins
ContextsWhere phrasing content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
cite — Link to the source of the quotation or more information about the edit
datetime — Date and (optionally) time of the change
The ins element represents an addition to the document.
del
ContextsWhere phrasing content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
cite — Link to the source of the quotation or more information about the edit
datetime — Date and (optionally) time of the change
The del element represents a removal from the document.
picture
ContextsWhere embedded content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
The picture element is a container which provides multiple sources to its contained img element to allow authors to declaratively control or give hints to the user agent about which image resource to use, based on the screen pixel density, viewport size, image format, and other factors. It represents its children.
source
Contexts
Omissions
Attributes
img
ContextsWhere embedded content is expected.
OmissionsNo end tag.
AttributesGlobal attributes
alt — Replacement text for use when images are not available
src — Address of the resource
srcset — Images to use in different situations, e.g., high-resolution displays, small monitors, etc.
sizes — Image sizes for different page layouts
crossorigin — How the element handles crossorigin requests
usemap — Name of image map to use
ismap — Whether the image is a server-side image map
width — Horizontal dimension
height — Vertical dimension
referrerpolicyReferrer policy for fetches initiated by the element
decoding — Decoding hint to use when processing this image for presentation
loading — Used when determining loading deferral
An img element represents an image.
iframe
ContextsWhere embedded content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
src — Address of the resource
srcdoc — A document to render in the iframe
name — Name of content navigable
sandbox — Security rules for nested content
allowPermissions policy to be applied to the iframe's contents
allowfullscreen — Whether to allow the iframe's contents to use requestFullscreen()
width — Horizontal dimension
height — Vertical dimension
referrerpolicyReferrer policy for fetches initiated by the element
loading — Used when determining loading deferral
The iframe element represents its content navigable.
embed
ContextsWhere embedded content is expected.
OmissionsNo end tag.
AttributesGlobal attributes
src — Address of the resource
type — Type of embedded resource
width — Horizontal dimension
height — Vertical dimension
Any other attribute that has no namespace (see prose).
The embed element provides an integration point for an external application or interactive content.
object
ContextsWhere embedded content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
data — Address of the resource
type — Type of embedded resource
name — Name of content navigable
form — Associates the element with a form element
width — Horizontal dimension
height — Vertical dimension
The object element can represent an external resource, which, depending on the type of the resource, will either be treated as an image or as a child navigable.
video
ContextsWhere embedded content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
src — Address of the resource
crossorigin — How the element handles crossorigin requests
poster — Poster frame to show prior to video playback
preload — Hints how much buffering the media resource will likely need
autoplay — Hint that the media resource can be started automatically when the page is loaded
playsinline — Encourage the user agent to display video content within the element's playback area
loop — Whether to loop the media resource
muted — Whether to mute the media resource by default
controls — Show user agent controls
width — Horizontal dimension
height — Vertical dimension
A video element is used for playing videos or movies, and audio files with captions.
audio
ContextsWhere embedded content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
src — Address of the resource
crossorigin — How the element handles crossorigin requests
preload — Hints how much buffering the media resource will likely need
autoplay — Hint that the media resource can be started automatically when the page is loaded
loop — Whether to loop the media resource
muted — Whether to mute the media resource by default
controls — Show user agent controls
An audio element represents a sound or audio stream.
track
ContextsAs a child of a media element, before any flow content.
OmissionsNo end tag.
AttributesGlobal attributes
kind — The type of text track
src — Address of the resource
srclang — Language of the text track
label — User-visible label
default — Enable the track if no other text track is more suitable
The track element allows authors to specify explicit external timed text tracks for media elements. It does not represent anything on its own.
map
ContextsWhere phrasing content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
name — Name of image map to reference from the usemap attribute
The map element, in conjunction with an img element and any area element descendants, defines an image map. The element represents its children.
area
ContextsWhere phrasing content is expected, but only if there is a map element ancestor.
OmissionsNo end tag.
AttributesGlobal attributes
alt — Replacement text for use when images are not available
coords — Coordinates for the shape to be created in an image map
shape — The kind of shape to be created in an image map
href — Address of the hyperlink
targetNavigable for hyperlink navigation
download — Whether to download the resource instead of navigating to it, and its filename if so
pingURLs to ping
rel — Relationship between the location in the document containing the hyperlink and the destination resource
referrerpolicyReferrer policy for fetches initiated by the element
The area element represents either a hyperlink with some text and a corresponding area on an image map, or a dead area on an image map.
table
ContextsWhere flow content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
The table element represents data with more than one dimension, in the form of a table.
caption
ContextsAs the first element child of a table element.
OmissionsA caption element's end tag can be omitted if the caption element is not immediately followed by ASCII whitespace or a comment.
AttributesGlobal attributes
The caption element represents the title of the table that is its parent, if it has a parent and that is a table element.
colgroup
ContextsAs a child of a table element, after any caption elements and before any thead, tbody, tfoot, and tr elements.
OmissionsA colgroup element's start tag can be omitted if the first thing inside the colgroup element is a col element, and if the element is not immediately preceded by another colgroup element whose end tag has been omitted. (It can't be omitted if the element is empty.)
A colgroup element's end tag can be omitted if the colgroup element is not immediately followed by ASCII whitespace or a comment.
AttributesGlobal attributes
span — Number of columns spanned by the element
The colgroup element represents a group of one or more columns in the table that is its parent, if it has a parent and that is a table element.
col
ContextsAs a child of a colgroup element that doesn't have a span attribute.
OmissionsNo end tag.
AttributesGlobal attributes
span — Number of columns spanned by the element
If a col element has a parent and that is a colgroup element that itself has a parent that is a table element, then the col element represents one or more columns in the column group represented by that colgroup.
tbody
ContextsAs a child of a table element, after any caption, colgroup, and thead elements, but only if there are no tr elements that are children of the table element.
OmissionsA tbody element's start tag can be omitted if the first thing inside the tbody element is a tr element, and if the element is not immediately preceded by a tbody, thead, or tfoot element whose end tag has been omitted. (It can't be omitted if the element is empty.)
A tbody element's end tag can be omitted if the tbody element is immediately followed by a tbody or tfoot element, or if there is no more content in the parent element.
AttributesGlobal attributes
The tbody element represents a block of rows that consist of a body of data for the parent table element, if the tbody element has a parent and it is a table.
thead
ContextsAs a child of a table element, after any caption, and colgroup elements and before any tbody, tfoot, and tr elements, but only if there are no other thead elements that are children of the table element.
OmissionsA thead element's end tag can be omitted if the thead element is immediately followed by a tbody or tfoot element.
AttributesGlobal attributes
The thead element represents the block of rows that consist of the column labels (headers) for the parent table element, if the thead element has a parent and it is a table.
tfoot
ContextsAs a child of a table element, after any caption, colgroup, thead, tbody, and tr elements, but only if there are no other tfoot elements that are children of the table element.
OmissionsA tfoot element's end tag can be omitted if there is no more content in the parent element.
AttributesGlobal attributes
The tfoot element represents the block of rows that consist of the column summaries (footers) for the parent table element, if the tfoot element has a parent and it is a table.
tr
ContextsAs a child of a thead element.
As a child of a tbody element.
As a child of a tfoot element.
As a child of a table element, after any caption, colgroup, and thead elements, but only if there are no tbody elements that are children of the table element.
OmissionsA tr element's end tag can be omitted if the tr element is immediately followed by another tr element, or if there is no more content in the parent element.
AttributesGlobal attributes
The tr element represents a row of cells in a table.
td
ContextsAs a child of a tr element.
OmissionsA td element's end tag can be omitted if the td element is immediately followed by a td or th element, or if there is no more content in the parent element.
AttributesGlobal attributes
colspan — Number of columns that the cell is to span
rowspan — Number of rows that the cell is to span
headers — The header cells for this cell
The td element represents a data cell in a table.
th
ContextsAs a child of a tr element.
OmissionsA th element's end tag can be omitted if the th element is immediately followed by a td or th element, or if there is no more content in the parent element.
AttributesGlobal attributes
colspan — Number of columns that the cell is to span
rowspan — Number of rows that the cell is to span
headers — The header cells for this cell
scope — Specifies which cells the header cell applies to
abbr — Alternative label to use for the header cell when referencing the cell in other contexts
The th element represents a header cell in a table.
form
ContextsWhere flow content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
accept-charset — Character encodings to use for form submission
actionURL to use for form submission
autocomplete — Default setting for autofill feature for controls in the form
enctypeEntry list encoding type to use for form submission
method — Variant to use for form submission
name — Name of form to use in the document.forms API
novalidate — Bypass form control validation for form submission
targetNavigable for form submission
rel
The form element represents a hyperlink that can be manipulated through a collection of form-associated elements, some of which can represent editable values that can be submitted to a server for processing.
label
ContextsWhere phrasing content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
for — Associate the label with form control
The label element represents a caption in a user interface. The caption can be associated with a specific form control, known as the label element's labeled control, either using the for attribute, or by putting the form control inside the label element itself.
input
Contexts
Omissions
Attributes
button
Contexts
Omissions
Attributes
select
ContextsWhere phrasing content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
autocomplete — Hint for form autofill feature
disabled — Whether the form control is disabled
form — Associates the element with a form element
multiple — Whether to allow multiple values
name — Name of the element to use for form submission and in the form.elements API
required — Whether the control is required for form submission
size — Size of the control
The select element represents a control for selecting amongst a set of options.
datalist
ContextsWhere phrasing content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
The datalist element represents a set of option elements that represent predefined options for other controls. In the rendering, the datalist element represents nothing and it, along with its children, should be hidden.
optgroup
ContextsAs a child of a select element.
OmissionsAn optgroup element's end tag can be omitted if the optgroup element is immediately followed by another optgroup element, or if there is no more content in the parent element.
AttributesGlobal attributes
disabled — Whether the form control is disabled
label — User-visible label
The optgroup element represents a group of option elements with a common label.
option
Contexts
Omissions
Attributes
textarea
ContextsWhere phrasing content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
autocomplete — Hint for form autofill feature
cols — Maximum number of characters per line
dirname — Name of form control to use for sending the element's directionality in form submission
disabled — Whether the form control is disabled
form — Associates the element with a form element
maxlength — Maximum length of value
minlength — Minimum length of value
name — Name of the element to use for form submission and in the form.elements API
placeholder — User-visible label to be placed within the form control
readonly — Whether to allow the value to be edited by the user
required — Whether the control is required for form submission
rows — Number of lines to show
wrap — How the value of the form control is to be wrapped for form submission
The textarea element represents a multiline plain text edit control for the element's raw value. The contents of the control represent the control's default value.
output
ContextsWhere phrasing content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
for — Specifies controls from which the output was calculated
form — Associates the element with a form element
name — Name of the element to use in the form.elements API.
The output element represents the result of a calculation performed by the application, or the result of a user action.
progress
ContextsWhere phrasing content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
value — Current value of the element
max — Upper bound of range
The progress element represents the completion progress of a task. The progress is either indeterminate, indicating that progress is being made but that it is not clear how much more work remains to be done before the task is complete (e.g. because the task is waiting for a remote host to respond), or the progress is a number in the range zero to a maximum, giving the fraction of work that has so far been completed.
meter
ContextsWhere phrasing content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
value — Current value of the element
min — Lower bound of range
max — Upper bound of range
low — High limit of low range
high — Low limit of high range
optimum — Optimum value in gauge
The meter element represents a scalar measurement within a known range, or a fractional value; for example disk usage, the relevance of a query result, or the fraction of a voting population to have selected a particular candidate.
fieldset
ContextsWhere flow content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
disabled — Whether the descendant form controls, except any inside legend, are disabled
form — Associates the element with a form element
name — Name of the element to use in the form.elements API.
The fieldset element represents a set of form controls (or other content) grouped together, optionally with a caption. The caption is given by the first legend element that is a child of the fieldset element, if any. The remainder of the descendants form the group.
legend
ContextsAs the first child of a fieldset element.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
The legend element represents a caption for the rest of the contents of the legend element's parent fieldset element, if any.
dirname
Contexts
Omissions
Attributes
details
ContextsWhere flow content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
open — Whether the details are visible
The details element represents a disclosure widget from which the user can obtain additional information or controls.
summary
ContextsAs the first child of a details element.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
The summary element represents a summary, caption, or legend for the rest of the contents of the summary element's parent details element, if any.
accesskey
Contexts
Omissions
Attributes
dialog
ContextsWhere flow content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
open — Whether the dialog box is showing
The dialog element represents a transitory part of an application, in the form of a small window ("dialog box"), which the user interacts with to perform a task or gather information. Once the user is done, the dialog can be automatically closed by the application, or manually closed by the user.
script
ContextsWhere metadata content is expected.
Where phrasing content is expected.
Where script-supporting elements are expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
src — Address of the resource
type — Type of script
nomodule — Prevents execution in user agents that support module scripts
async — Execute script when available, without blocking while fetching
defer — Defer script execution
crossorigin — How the element handles crossorigin requests
integrity — Integrity metadata used in Subresource Integrity checks [SRI]
referrerpolicyReferrer policy for fetches initiated by the element
blocking — Whether the element is potentially render-blocking
The script element allows authors to include dynamic script and data blocks in their documents. The element does not represent content for the user.
noscript
ContextsIn a head element of an HTML document, if there are no ancestor noscript elements.
Where phrasing content is expected in HTML documents, if there are no ancestor noscript elements.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
The noscript element represents nothing if scripting is enabled, and represents its children if scripting is disabled. It is used to present different markup to user agents that support scripting and those that don't support scripting, by affecting how the document is parsed.
template
ContextsWhere metadata content is expected.
Where phrasing content is expected.
Where script-supporting elements are expected.
As a child of a colgroup element that doesn't have a span attribute.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
The template element is used to declare fragments of HTML that can be cloned and inserted in the document by script.
slot
ContextsWhere phrasing content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
name — Name of shadow tree slot
The slot element defines a slot. It is typically used in a shadow tree. A slot element represents its assigned nodes, if any, and its contents otherwise.
canvas
ContextsWhere embedded content is expected.
OmissionsNeither tag is omissible.
AttributesGlobal attributes
width — Horizontal dimension
height — Vertical dimension
The canvas element provides scripts with a resolution-dependent bitmap canvas, which can be used for rendering graphs, game graphics, art, or other visual images on the fly.