An
HTML element is an individual component of an
HTMLHyperText Markup Language is the predominant markup language for web pages. HTML elements are the basic building-blocks of webpages....
document. HTML documents are composed of a
treeA tree structure is a way of representing the hierarchical nature of a structure in a graphical form. It is named a "tree structure" because the classic representation resembles a tree, even though the chart is generally upside down compared to an actual tree, with the "root" at the top and the...
of HTML elements and other
nodesA node is a record consisting of one or more fields that are links to other nodes, and a data field. The link and data fields are often implemented by pointers or references although it is also quite common for the data to be embedded directly in the node. Nodes are used to build linked, often...
, such as text nodes. Each element can have attributes specified. Elements can also have content, including other elements and text. HTML elements represent
semanticsSemantics is the study of meaning. It focuses on the relation between signifiers, such as words, phrases, signs and symbols, and what they stand for, their denotata....
, or meaning. For example, the
title element represents the title of the document.
In the HTML syntax, most elements are written with a start tag and an end tag, with the content in between. Tags are composed of the name of the element, surrounded by angle brackets. An end tag also has a slash after the opening angle bracket, to distinguish it from the start tag. For example, a paragraph, which is represented by the
p element, would be written as
In the HTML syntax, most elements are written ...
However, not all of these elements
require the end tag, or even the start tag, to be present. Some elements, the so-called
void elements don't have an end tag. A typical example is the
br element, which represents a significant line break, such as in a poem or an address. For example, the address of the dentist in
Finding NemoFinding Nemo is a 2003 American comi-drama animated film written by Andrew Stanton, directed by Andrew Stanton and Lee Unkrich and produced by Pixar. It tells the story of the overly protective clownfish Marlin who, along with a regal tang called Dory , searches for his abducted son Nemo...
would be written as
P. Sherman
42 Wallaby Way
Sydney
Attributes are specified on the start tag. For example, the
abbr element, which represents an
abbreviationAn abbreviation is a shortened form of a word or phrase. Usually, but not always, it consists of a letter or group of letters taken from the word or phrase...
, expects a
title attribute with its expansion. This would be written as
HTML
Syntax
There are multiple kinds of HTML elements: void elements, raw text elements, and normal elements.
Void elements only have a start tag, which contains any attributes. One example is the
link element, for which the syntax is
This
link element points the browser at a stylesheet to use when presenting the HTML document to the user. Note that in the HTML syntax, attributes don't have to be quoted. When using the
XMLExtensible Markup Language is a set of rules for encoding documents in machine-readable form. It is defined in the XML 1.0 Specification produced by the W3C, and several other related specifications, all gratis open standards....
syntax (
XHTMLXHTML is a family of XML markup languages that mirror or extend versions of the widely-used Hypertext Markup Language , the language in which web pages are written....
), on the other hand, all attributes must be quoted, and a trailing slash is required before the last angle bracket:
Raw text elements are constructed with:
- a start tag (
<tag>) marking the beginning of an element, which may incorporate any number of attributes;
- some amount of text content, but no elements (all tags, apart from the applicable end tag, will be interpreted as content);
- an end tag, in which the element name is prepended with a forward slash
The slash is a sign used as a punctuation mark and for various other purposes. It is now often called a forward slash , and many other alternative names.-History:...
: </tag>. In some versions of HTML, the end tag is optional for some elements. The end tag is required in XHTML.
Normal elements usually have both a start tag and an end tag, although for some elements the end tag, or both tags, can be omitted. It is constructed in a similar way:
- a start tag (
<tag>) marking the beginning of an element, which may incorporate any number of attributes;
- some amount of content, including text and other elements;
- an end tag, in which the element name is prepended with a forward slash
The slash is a sign used as a punctuation mark and for various other purposes. It is now often called a forward slash , and many other alternative names.-History:...
: </tag>.
Attributes define desired behavior or indicate additional element properties. Most attributes require a
value. In HTML, the value can be left unquoted if it doesn't include spaces (
name=value), or it can be quoted with single or double quotes (
name='value' or
name="value"). In XML, those quotes are required. Boolean attributes, on the other hand, don't require a value to be specified. An example is the
checked for checkboxes:
In the XML syntax, though, the name should be repeated as the value:
Informally, HTML elements are sometimes referred to as "tags" (an example of
synecdocheSynecdoche , meaning "simultaneous understanding") is a figure of speech in which a term is used in one of the following ways:* Part of something is used to refer to the whole thing , or...
), though many prefer the term
tag strictly in reference to the markup delimiting the start and end of an element.
Element (and attribute) names may be written in any combination of upper or lower case in HTML, but must be in lower case in XHTML. The canonical form was upper-case until HTML 4, and was used in HTML specifications, but in recent years, lower-case has become more common.
Element standards
HTML elements are defined in a series of freely-available open standards issued since 1995, initially by the IETF and subsequently by the W3C.
Since the early 1990s, developers of user agents (e.g.
web browsersA web browser is a software application for retrieving, presenting, and traversing information resources on the World Wide Web. An information resource is identified by a Uniform Resource Identifier and may be a web page, image, video, or other piece of content...
) have often developed their own elements, some of which have been adopted in later standards. Other user agents may not recognize non-standard elements, and they may be ignored or displayed improperly.
In 1998,
XMLExtensible Markup Language is a set of rules for encoding documents in machine-readable form. It is defined in the XML 1.0 Specification produced by the W3C, and several other related specifications, all gratis open standards....
(a simplified form of SGML) introduced mechanisms to allow anyone to develop their own elements and incorporate them in XHTML documents, for use with XML-aware user agents.
Subsequently, HTML 4.01 was rewritten in an XML-compatible form, XHTML 1.0 (
eXtensible HTML). The elements in each are identical, and in most cases valid XHTML 1.0 documents will be valid or nearly-valid HTML 4.01 documents. This article mainly focuses on real HTML, unless noted otherwise; however, it remains applicable to XHTML.
(See HTML for a discussion of the minor differences between the two).
Element status
Since the first version of HTML, several elements have become outmoded, and are
deprecated in later standards, or do not appear at all, in which case they are
invalid (and will be found invalid, and perhaps not displayed, by
validatingXML validation is the process of checking a document written in XML to confirm that it is both "well-formed" and also "valid" in that it follows a defined structure. A "well-formed" document follows the basic syntactic rules of XML, which are the same for all XML documents...
user agents).
At present, the status of elements is complicated by the existence of three types of HTML 4.01 / XHTML 1.0 DTD:
- Transitional, which contain deprecated elements, but which were intended to provide a transitional period during which authors could update their practices;
- Frameset, which are versions of the Transitional DTDs which also allow authors to write frameset documents;
- Strict, which is the up-to date (as at 1999) form of HTML.
The first Standard (HTML 2.0) contained four deprecated elements, one of which was invalid in HTML 3.2. All four are invalid in HTML 4.01 Transitional, which also deprecated a further ten elements. All of these, plus two others, are invalid in HTML 4.01 Strict. While the frame elements are still current in the sense of being present in the Transitional and Frameset DTDs, there are no plans to preserve them in future standards, as their function has been largely replaced, and they are highly problematic for user accessibility.
(Strictly speaking, the most recent
XHTML standard, XHTML 1.1 (2001), does not include frames at all; it is approximately equivalent to XHTML 1.0 Strict, but also includes the
Ruby markup module.)
A common source of confusion is the loose use of
deprecated to refer to both deprecated and invalid status, and to elements which are expected to be formally deprecated in future.
Presentation and behavior
In keeping with the principle of
separation of concernsIn computer science, separation of concerns is the process of separating a computer program into distinct features that overlap in functionality as little as possible. A concern is any piece of interest or focus in a program. Typically, concerns are synonymous with features or behaviors...
, the function of HTML is primarily to add structural and semantic information to the raw text of a document.
Presentation and
behavior are separate functions, which can be added as desired, ideally through links to external documents such as stylesheets,
graphicsGraphics are visual presentations on some surface, such as a wall, canvas, computer screen, paper, or stone to brand, inform, illustrate, or entertain. Examples are photographs, drawings, Line Art, graphs, diagrams, typography, numbers, symbols, geometric designs, maps, engineering drawings,or...
files, and
scriptsClient-side scripting generally refers to the class of computer programs on the web that are executed client-side, by the user's web browser, instead of server-side...
.
This allows the document to be presented by different user agents according to their purposes and abilities; for example, a user agent can select an appropriate stylesheet to present a document by displaying on a monitor, printing on paper, or to determine speech characteristics in an aural user agent. The structural and semantic functions of the markup remain identical in each case.
Historically, user agents did not always support these features. In the 1990s, as a stop-gap, presentational elements were added to HTML, at the cost of creating problems for interoperability and user accessibility. This is now regarded as outmoded and has been superseded by stylesheet-based design; most presentational elements are now deprecated.
External image files are incorporated with the
img or
object elements. (With XHTML, the SVG language can also be used to write graphics within the document, though linking to external SVG files is generally simpler.) Where an image is not purely decorative, HTML allows replacement content with similar semantic value to be provided for non-visual user agents.
An HTML document can also be extended through the use of scripts to provide additional behaviors beyond the abilities of HTML hyperlinks and forms.
The elements
style and
script, with related attributes, provide reference points in HTML markup for links to stylesheets and scripts. They can also contain instructions directly.
- In the document head, script and style may either link to shared external documents, or contain embedded instructions. (The link element can also be used to link stylesheets.)
- The style attribute is valid in most document body elements for inclusion of inline style instructions.
- Event-handling attributes, which provide links to scripts, are optional in most elements.
- script can occur at any point in the document body.
- For user agents which do not operate scripts, the noscript element provides alternative content where appropriate; however, it can only be used as a block-level element.
Document structure elements
- The Root element
Each XML document has exactly one single root element. This element is also known as the document element. It encloses all the other elements and is therefore the sole parent element to all the other elements....
of an HTML document; all other elements are contained in this.
- The HTML element delimits the beginning and the end of an HTML document.
- Standardized in HTML 2.0; still current.
- Container for processing information and metadata for an HTML document.
- Standardized in HTML 2.0; still current.
- Container for the displayable content of an HTML document.
- Standardized in HTML 2.0; still current.
Document head elements
- Specifies a base URL
In computing, a uniform resource locator or universal resource locator is a specific character string that constitutes a reference to an Internet resource....
for all relative href and other links in the document. Must appear before any element that refers to an external resource. HTML permits only one base element for each document. The base element has attributes, but no contents.
- A development version of BASE is mentioned in HTML Tags; standardized in HTML 2.0; still current.
- Specifies a base font size, typeface, and color for the document. Used together with
font elements. DeprecatedIn the process of authoring computer software, its standards or documentation, deprecation is a status applied to software features to indicate that they should be avoided, typically because they have been superseded...
in favor of stylesheets.
- Standardized in HTML 3.2; deprecated in HTML 4.0 Transitional; invalid in HTML 4.0 Strict.
isindex could either appear in the document head or in the body, but only once in a document. See Forms.
- Specifies links to other documents, such as previous and next links, or alternate versions. A common use is to link to external stylesheet
Cascading Style Sheets is a style sheet language used to describe the presentation semantics of a document written in a markup language...
s, using the form:
<link rel="stylesheet" type="text/css" href="url" title="description_of_style">
- A less-common, but important, usage is to supply navigation hints consistently through use of microformat
A microformat is a web-based approach to semantic markup which seeks to re-use existing HTML/XHTML tags to convey metadata and other attributes in web pages and other contexts that support HTML, such as RSS...
s. Several common relationships are defined, that may be exposed to users through the browser interface rather than directly in the web page.
<link rel="next" href="url">
- A document’s
head element may contain any number of link elements. The link element has attributes, but no contents.
- LINK existed in HTML Internet Draft 1.2, and was standardized in HTML 2.0; still current.
{{Selfref|This article is about the HTMLHyperText Markup Language is the predominant markup language for web pages. HTML elements are the basic building-blocks of webpages....
elements in general. For information on how to format
WikipediaWikipedia is a free, web-based, collaborative, multilingual encyclopedia project supported by the non-profit Wikimedia Foundation. Its 20 million articles have been written collaboratively by volunteers around the world. Almost all of its articles can be edited by anyone with access to the site,...
entries, see Help:Wiki markup and Help:HTML in wikitext}}
{{Html series}}
An
HTML element is an individual component of an
HTMLHyperText Markup Language is the predominant markup language for web pages. HTML elements are the basic building-blocks of webpages....
document. HTML documents are composed of a
treeA tree structure is a way of representing the hierarchical nature of a structure in a graphical form. It is named a "tree structure" because the classic representation resembles a tree, even though the chart is generally upside down compared to an actual tree, with the "root" at the top and the...
of HTML elements and other
nodesA node is a record consisting of one or more fields that are links to other nodes, and a data field. The link and data fields are often implemented by pointers or references although it is also quite common for the data to be embedded directly in the node. Nodes are used to build linked, often...
, such as text nodes. Each element can have attributes specified. Elements can also have content, including other elements and text. HTML elements represent
semanticsSemantics is the study of meaning. It focuses on the relation between signifiers, such as words, phrases, signs and symbols, and what they stand for, their denotata....
, or meaning. For example, the
title element represents the title of the document.
In the HTML syntax, most elements are written with a start tag and an end tag, with the content in between. Tags are composed of the name of the element, surrounded by angle brackets. An end tag also has a slash after the opening angle bracket, to distinguish it from the start tag. For example, a paragraph, which is represented by the
p element, would be written as
In the HTML syntax, most elements are written ...
However, not all of these elements
require the end tag, or even the start tag, to be present. Some elements, the so-called
void elements don't have an end tag. A typical example is the
br element, which represents a significant line break, such as in a poem or an address. For example, the address of the dentist in
Finding NemoFinding Nemo is a 2003 American comi-drama animated film written by Andrew Stanton, directed by Andrew Stanton and Lee Unkrich and produced by Pixar. It tells the story of the overly protective clownfish Marlin who, along with a regal tang called Dory , searches for his abducted son Nemo...
would be written as
P. Sherman
42 Wallaby Way
Sydney
Attributes are specified on the start tag. For example, the
abbr element, which represents an
abbreviationAn abbreviation is a shortened form of a word or phrase. Usually, but not always, it consists of a letter or group of letters taken from the word or phrase...
, expects a
title attribute with its expansion. This would be written as
HTML
Syntax
There are multiple kinds of HTML elements: void elements, raw text elements, and normal elements.
Void elements only have a start tag, which contains any attributes. One example is the
link element, for which the syntax is
This
link element points the browser at a stylesheet to use when presenting the HTML document to the user. Note that in the HTML syntax, attributes don't have to be quoted. When using the
XMLExtensible Markup Language is a set of rules for encoding documents in machine-readable form. It is defined in the XML 1.0 Specification produced by the W3C, and several other related specifications, all gratis open standards....
syntax (
XHTMLXHTML is a family of XML markup languages that mirror or extend versions of the widely-used Hypertext Markup Language , the language in which web pages are written....
), on the other hand, all attributes must be quoted, and a trailing slash is required before the last angle bracket:
Raw text elements are constructed with:
- a start tag (
<tag>) marking the beginning of an element, which may incorporate any number of attributes;
- some amount of text content, but no elements (all tags, apart from the applicable end tag, will be interpreted as content);
- an end tag, in which the element name is prepended with a forward slash
The slash is a sign used as a punctuation mark and for various other purposes. It is now often called a forward slash , and many other alternative names.-History:...
: </tag>. In some versions of HTML, the end tag is optional for some elements. The end tag is required in XHTML.
Normal elements usually have both a start tag and an end tag, although for some elements the end tag, or both tags, can be omitted. It is constructed in a similar way:
- a start tag (
<tag>) marking the beginning of an element, which may incorporate any number of attributes;
- some amount of content, including text and other elements;
- an end tag, in which the element name is prepended with a forward slash
The slash is a sign used as a punctuation mark and for various other purposes. It is now often called a forward slash , and many other alternative names.-History:...
: </tag>.
Attributes define desired behavior or indicate additional element properties. Most attributes require a
value. In HTML, the value can be left unquoted if it doesn't include spaces (
name=value), or it can be quoted with single or double quotes (
name='value' or
name="value"). In XML, those quotes are required. Boolean attributes, on the other hand, don't require a value to be specified. An example is the
checked for checkboxes:
In the XML syntax, though, the name should be repeated as the value:
Informally, HTML elements are sometimes referred to as "tags" (an example of
synecdocheSynecdoche , meaning "simultaneous understanding") is a figure of speech in which a term is used in one of the following ways:* Part of something is used to refer to the whole thing , or...
), though many prefer the term
tag strictly in reference to the markup delimiting the start and end of an element.
Element (and attribute) names may be written in any combination of upper or lower case in HTML, but must be in lower case in XHTML. The canonical form was upper-case until HTML 4, and was used in HTML specifications, but in recent years, lower-case has become more common.
Element standards
HTML elements are defined in a series of freely-available open standards issued since 1995, initially by the IETF and subsequently by the W3C.
Since the early 1990s, developers of user agents (e.g.
web browsersA web browser is a software application for retrieving, presenting, and traversing information resources on the World Wide Web. An information resource is identified by a Uniform Resource Identifier and may be a web page, image, video, or other piece of content...
) have often developed their own elements, some of which have been adopted in later standards. Other user agents may not recognize non-standard elements, and they may be ignored or displayed improperly.
In 1998,
XMLExtensible Markup Language is a set of rules for encoding documents in machine-readable form. It is defined in the XML 1.0 Specification produced by the W3C, and several other related specifications, all gratis open standards....
(a simplified form of SGML) introduced mechanisms to allow anyone to develop their own elements and incorporate them in XHTML documents, for use with XML-aware user agents.
Subsequently, HTML 4.01 was rewritten in an XML-compatible form, XHTML 1.0 (
eXtensible HTML). The elements in each are identical, and in most cases valid XHTML 1.0 documents will be valid or nearly-valid HTML 4.01 documents. This article mainly focuses on real HTML, unless noted otherwise; however, it remains applicable to XHTML.
(See HTML for a discussion of the minor differences between the two).
Element status
Since the first version of HTML, several elements have become outmoded, and are
deprecated in later standards, or do not appear at all, in which case they are
invalid (and will be found invalid, and perhaps not displayed, by
validatingXML validation is the process of checking a document written in XML to confirm that it is both "well-formed" and also "valid" in that it follows a defined structure. A "well-formed" document follows the basic syntactic rules of XML, which are the same for all XML documents...
user agents).
At present, the status of elements is complicated by the existence of three types of HTML 4.01 / XHTML 1.0 DTD:
- Transitional, which contain deprecated elements, but which were intended to provide a transitional period during which authors could update their practices;
- Frameset, which are versions of the Transitional DTDs which also allow authors to write frameset documents;
- Strict, which is the up-to date (as at 1999) form of HTML.
The first Standard (HTML 2.0) contained four deprecated elements, one of which was invalid in HTML 3.2. All four are invalid in HTML 4.01 Transitional, which also deprecated a further ten elements. All of these, plus two others, are invalid in HTML 4.01 Strict. While the frame elements are still current in the sense of being present in the Transitional and Frameset DTDs, there are no plans to preserve them in future standards, as their function has been largely replaced, and they are highly problematic for user accessibility.
(Strictly speaking, the most recent
XHTML standard, XHTML 1.1 (2001), does not include frames at all; it is approximately equivalent to XHTML 1.0 Strict, but also includes the
Ruby markup module.)
A common source of confusion is the loose use of
deprecated to refer to both deprecated and invalid status, and to elements which are expected to be formally deprecated in future.
Presentation and behavior
In keeping with the principle of
separation of concernsIn computer science, separation of concerns is the process of separating a computer program into distinct features that overlap in functionality as little as possible. A concern is any piece of interest or focus in a program. Typically, concerns are synonymous with features or behaviors...
, the function of HTML is primarily to add structural and semantic information to the raw text of a document.
Presentation and
behavior are separate functions, which can be added as desired, ideally through links to external documents such as stylesheets,
graphicsGraphics are visual presentations on some surface, such as a wall, canvas, computer screen, paper, or stone to brand, inform, illustrate, or entertain. Examples are photographs, drawings, Line Art, graphs, diagrams, typography, numbers, symbols, geometric designs, maps, engineering drawings,or...
files, and
scriptsClient-side scripting generally refers to the class of computer programs on the web that are executed client-side, by the user's web browser, instead of server-side...
.
This allows the document to be presented by different user agents according to their purposes and abilities; for example, a user agent can select an appropriate stylesheet to present a document by displaying on a monitor, printing on paper, or to determine speech characteristics in an aural user agent. The structural and semantic functions of the markup remain identical in each case.
Historically, user agents did not always support these features. In the 1990s, as a stop-gap, presentational elements were added to HTML, at the cost of creating problems for interoperability and user accessibility. This is now regarded as outmoded and has been superseded by stylesheet-based design; most presentational elements are now deprecated.
External image files are incorporated with the
img or
object elements. (With XHTML, the SVG language can also be used to write graphics within the document, though linking to external SVG files is generally simpler.) Where an image is not purely decorative, HTML allows replacement content with similar semantic value to be provided for non-visual user agents.
An HTML document can also be extended through the use of scripts to provide additional behaviors beyond the abilities of HTML hyperlinks and forms.
The elements
style and
script, with related attributes, provide reference points in HTML markup for links to stylesheets and scripts. They can also contain instructions directly.
- In the document head, script and style may either link to shared external documents, or contain embedded instructions. (The link element can also be used to link stylesheets.)
- The style attribute is valid in most document body elements for inclusion of inline style instructions.
- Event-handling attributes, which provide links to scripts, are optional in most elements.
- script can occur at any point in the document body.
- For user agents which do not operate scripts, the noscript element provides alternative content where appropriate; however, it can only be used as a block-level element.
Document structure elements
{{Anchor|html|html_tag}}{{XMLElement|html|HTML|...}}
- The Root element
Each XML document has exactly one single root element. This element is also known as the document element. It encloses all the other elements and is therefore the sole parent element to all the other elements....
of an HTML document; all other elements are contained in this.
- The HTML element delimits the beginning and the end of an HTML document.
- Standardized in HTML 2.0; still current.
{{Anchor|head|head_tag}}{{XMLElement|head|Head|...}}
- Container for processing information and metadata for an HTML document.
- Standardized in HTML 2.0; still current.
{{Anchor|body|body_tag}}{{XMLElement|body|Body|...}}
- Container for the displayable content of an HTML document.
- Standardized in HTML 2.0; still current.
Document head elements
{{Anchor|base|base_tag}}{{HTMLElement|base|Base||end=no}}
- Specifies a base URL
In computing, a uniform resource locator or universal resource locator is a specific character string that constitutes a reference to an Internet resource....
for all relative href and other links in the document. Must appear before any element that refers to an external resource. HTML permits only one base element for each document. The base element has attributes, but no contents.
- A development version of BASE is mentioned in HTML Tags; standardized in HTML 2.0; still current.
{{Anchor|basefont|basefont_tag}}{{HTMLElement|basefont|Basefont||end=no|deprecated=1}}
- Specifies a base font size, typeface, and color for the document. Used together with
font elements. DeprecatedIn the process of authoring computer software, its standards or documentation, deprecation is a status applied to software features to indicate that they should be avoided, typically because they have been superseded...
in favor of stylesheets.
- Standardized in HTML 3.2; deprecated in HTML 4.0 Transitional; invalid in HTML 4.0 Strict.
{{Anchor|isindex|isindex_tag}}{{HTMLElement|isindex|Index|end=no|deprecated=1}}
isindex could either appear in the document head or in the body, but only once in a document. See Forms.
{{Anchor|link|link_tag}}{{HTMLElement|link|Link|end=no}}
{{see also|Link relations}}
- Specifies links to other documents, such as previous and next links, or alternate versions. A common use is to link to external stylesheet
Cascading Style Sheets is a style sheet language used to describe the presentation semantics of a document written in a markup language...
s, using the form:
<link rel="stylesheet" type="text/css" href="url" title="description_of_style">
- A less-common, but important, usage is to supply navigation hints consistently through use of microformat
A microformat is a web-based approach to semantic markup which seeks to re-use existing HTML/XHTML tags to convey metadata and other attributes in web pages and other contexts that support HTML, such as RSS...
s. Several common relationships are defined, that may be exposed to users through the browser interface rather than directly in the web page.
<link rel="next" href="url">
- A document’s
head element may contain any number of link elements. The link element has attributes, but no contents.
- LINK existed in HTML Internet Draft 1.2, and was standardized in HTML 2.0; still current.
{{Anchor|meta|meta_tag}}
{{Selfref|This article is about the HTMLHyperText Markup Language is the predominant markup language for web pages. HTML elements are the basic building-blocks of webpages....
elements in general. For information on how to format
WikipediaWikipedia is a free, web-based, collaborative, multilingual encyclopedia project supported by the non-profit Wikimedia Foundation. Its 20 million articles have been written collaboratively by volunteers around the world. Almost all of its articles can be edited by anyone with access to the site,...
entries, see Help:Wiki markup and Help:HTML in wikitext}}
{{Html series}}
An
HTML element is an individual component of an
HTMLHyperText Markup Language is the predominant markup language for web pages. HTML elements are the basic building-blocks of webpages....
document. HTML documents are composed of a
treeA tree structure is a way of representing the hierarchical nature of a structure in a graphical form. It is named a "tree structure" because the classic representation resembles a tree, even though the chart is generally upside down compared to an actual tree, with the "root" at the top and the...
of HTML elements and other
nodesA node is a record consisting of one or more fields that are links to other nodes, and a data field. The link and data fields are often implemented by pointers or references although it is also quite common for the data to be embedded directly in the node. Nodes are used to build linked, often...
, such as text nodes. Each element can have attributes specified. Elements can also have content, including other elements and text. HTML elements represent
semanticsSemantics is the study of meaning. It focuses on the relation between signifiers, such as words, phrases, signs and symbols, and what they stand for, their denotata....
, or meaning. For example, the
title element represents the title of the document.
In the HTML syntax, most elements are written with a start tag and an end tag, with the content in between. Tags are composed of the name of the element, surrounded by angle brackets. An end tag also has a slash after the opening angle bracket, to distinguish it from the start tag. For example, a paragraph, which is represented by the
p element, would be written as
In the HTML syntax, most elements are written ...
However, not all of these elements
require the end tag, or even the start tag, to be present. Some elements, the so-called
void elements don't have an end tag. A typical example is the
br element, which represents a significant line break, such as in a poem or an address. For example, the address of the dentist in
Finding NemoFinding Nemo is a 2003 American comi-drama animated film written by Andrew Stanton, directed by Andrew Stanton and Lee Unkrich and produced by Pixar. It tells the story of the overly protective clownfish Marlin who, along with a regal tang called Dory , searches for his abducted son Nemo...
would be written as
P. Sherman
42 Wallaby Way
Sydney
Attributes are specified on the start tag. For example, the
abbr element, which represents an
abbreviationAn abbreviation is a shortened form of a word or phrase. Usually, but not always, it consists of a letter or group of letters taken from the word or phrase...
, expects a
title attribute with its expansion. This would be written as
HTML
Syntax
There are multiple kinds of HTML elements: void elements, raw text elements, and normal elements.
Void elements only have a start tag, which contains any attributes. One example is the
link element, for which the syntax is
This
link element points the browser at a stylesheet to use when presenting the HTML document to the user. Note that in the HTML syntax, attributes don't have to be quoted. When using the
XMLExtensible Markup Language is a set of rules for encoding documents in machine-readable form. It is defined in the XML 1.0 Specification produced by the W3C, and several other related specifications, all gratis open standards....
syntax (
XHTMLXHTML is a family of XML markup languages that mirror or extend versions of the widely-used Hypertext Markup Language , the language in which web pages are written....
), on the other hand, all attributes must be quoted, and a trailing slash is required before the last angle bracket:
Raw text elements are constructed with:
- a start tag (
<tag>) marking the beginning of an element, which may incorporate any number of attributes;
- some amount of text content, but no elements (all tags, apart from the applicable end tag, will be interpreted as content);
- an end tag, in which the element name is prepended with a forward slash
The slash is a sign used as a punctuation mark and for various other purposes. It is now often called a forward slash , and many other alternative names.-History:...
: </tag>. In some versions of HTML, the end tag is optional for some elements. The end tag is required in XHTML.
Normal elements usually have both a start tag and an end tag, although for some elements the end tag, or both tags, can be omitted. It is constructed in a similar way:
- a start tag (
<tag>) marking the beginning of an element, which may incorporate any number of attributes;
- some amount of content, including text and other elements;
- an end tag, in which the element name is prepended with a forward slash
The slash is a sign used as a punctuation mark and for various other purposes. It is now often called a forward slash , and many other alternative names.-History:...
: </tag>.
Attributes define desired behavior or indicate additional element properties. Most attributes require a
value. In HTML, the value can be left unquoted if it doesn't include spaces (
name=value), or it can be quoted with single or double quotes (
name='value' or
name="value"). In XML, those quotes are required. Boolean attributes, on the other hand, don't require a value to be specified. An example is the
checked for checkboxes:
In the XML syntax, though, the name should be repeated as the value:
Informally, HTML elements are sometimes referred to as "tags" (an example of
synecdocheSynecdoche , meaning "simultaneous understanding") is a figure of speech in which a term is used in one of the following ways:* Part of something is used to refer to the whole thing , or...
), though many prefer the term
tag strictly in reference to the markup delimiting the start and end of an element.
Element (and attribute) names may be written in any combination of upper or lower case in HTML, but must be in lower case in XHTML. The canonical form was upper-case until HTML 4, and was used in HTML specifications, but in recent years, lower-case has become more common.
Element standards
HTML elements are defined in a series of freely-available open standards issued since 1995, initially by the IETF and subsequently by the W3C.
Since the early 1990s, developers of user agents (e.g.
web browsersA web browser is a software application for retrieving, presenting, and traversing information resources on the World Wide Web. An information resource is identified by a Uniform Resource Identifier and may be a web page, image, video, or other piece of content...
) have often developed their own elements, some of which have been adopted in later standards. Other user agents may not recognize non-standard elements, and they may be ignored or displayed improperly.
In 1998,
XMLExtensible Markup Language is a set of rules for encoding documents in machine-readable form. It is defined in the XML 1.0 Specification produced by the W3C, and several other related specifications, all gratis open standards....
(a simplified form of SGML) introduced mechanisms to allow anyone to develop their own elements and incorporate them in XHTML documents, for use with XML-aware user agents.
Subsequently, HTML 4.01 was rewritten in an XML-compatible form, XHTML 1.0 (
eXtensible HTML). The elements in each are identical, and in most cases valid XHTML 1.0 documents will be valid or nearly-valid HTML 4.01 documents. This article mainly focuses on real HTML, unless noted otherwise; however, it remains applicable to XHTML.
(See HTML for a discussion of the minor differences between the two).
Element status
Since the first version of HTML, several elements have become outmoded, and are
deprecated in later standards, or do not appear at all, in which case they are
invalid (and will be found invalid, and perhaps not displayed, by
validatingXML validation is the process of checking a document written in XML to confirm that it is both "well-formed" and also "valid" in that it follows a defined structure. A "well-formed" document follows the basic syntactic rules of XML, which are the same for all XML documents...
user agents).
At present, the status of elements is complicated by the existence of three types of HTML 4.01 / XHTML 1.0 DTD:
- Transitional, which contain deprecated elements, but which were intended to provide a transitional period during which authors could update their practices;
- Frameset, which are versions of the Transitional DTDs which also allow authors to write frameset documents;
- Strict, which is the up-to date (as at 1999) form of HTML.
The first Standard (HTML 2.0) contained four deprecated elements, one of which was invalid in HTML 3.2. All four are invalid in HTML 4.01 Transitional, which also deprecated a further ten elements. All of these, plus two others, are invalid in HTML 4.01 Strict. While the frame elements are still current in the sense of being present in the Transitional and Frameset DTDs, there are no plans to preserve them in future standards, as their function has been largely replaced, and they are highly problematic for user accessibility.
(Strictly speaking, the most recent
XHTML standard, XHTML 1.1 (2001), does not include frames at all; it is approximately equivalent to XHTML 1.0 Strict, but also includes the
Ruby markup module.)
A common source of confusion is the loose use of
deprecated to refer to both deprecated and invalid status, and to elements which are expected to be formally deprecated in future.
Presentation and behavior
In keeping with the principle of
separation of concernsIn computer science, separation of concerns is the process of separating a computer program into distinct features that overlap in functionality as little as possible. A concern is any piece of interest or focus in a program. Typically, concerns are synonymous with features or behaviors...
, the function of HTML is primarily to add structural and semantic information to the raw text of a document.
Presentation and
behavior are separate functions, which can be added as desired, ideally through links to external documents such as stylesheets,
graphicsGraphics are visual presentations on some surface, such as a wall, canvas, computer screen, paper, or stone to brand, inform, illustrate, or entertain. Examples are photographs, drawings, Line Art, graphs, diagrams, typography, numbers, symbols, geometric designs, maps, engineering drawings,or...
files, and
scriptsClient-side scripting generally refers to the class of computer programs on the web that are executed client-side, by the user's web browser, instead of server-side...
.
This allows the document to be presented by different user agents according to their purposes and abilities; for example, a user agent can select an appropriate stylesheet to present a document by displaying on a monitor, printing on paper, or to determine speech characteristics in an aural user agent. The structural and semantic functions of the markup remain identical in each case.
Historically, user agents did not always support these features. In the 1990s, as a stop-gap, presentational elements were added to HTML, at the cost of creating problems for interoperability and user accessibility. This is now regarded as outmoded and has been superseded by stylesheet-based design; most presentational elements are now deprecated.
External image files are incorporated with the
img or
object elements. (With XHTML, the SVG language can also be used to write graphics within the document, though linking to external SVG files is generally simpler.) Where an image is not purely decorative, HTML allows replacement content with similar semantic value to be provided for non-visual user agents.
An HTML document can also be extended through the use of scripts to provide additional behaviors beyond the abilities of HTML hyperlinks and forms.
The elements
style and
script, with related attributes, provide reference points in HTML markup for links to stylesheets and scripts. They can also contain instructions directly.
- In the document head, script and style may either link to shared external documents, or contain embedded instructions. (The link element can also be used to link stylesheets.)
- The style attribute is valid in most document body elements for inclusion of inline style instructions.
- Event-handling attributes, which provide links to scripts, are optional in most elements.
- script can occur at any point in the document body.
- For user agents which do not operate scripts, the noscript element provides alternative content where appropriate; however, it can only be used as a block-level element.
Document structure elements
{{Anchor|html|html_tag}}{{XMLElement|html|HTML|...}}
- The Root element
Each XML document has exactly one single root element. This element is also known as the document element. It encloses all the other elements and is therefore the sole parent element to all the other elements....
of an HTML document; all other elements are contained in this.
- The HTML element delimits the beginning and the end of an HTML document.
- Standardized in HTML 2.0; still current.
{{Anchor|head|head_tag}}{{XMLElement|head|Head|...}}
- Container for processing information and metadata for an HTML document.
- Standardized in HTML 2.0; still current.
{{Anchor|body|body_tag}}{{XMLElement|body|Body|...}}
- Container for the displayable content of an HTML document.
- Standardized in HTML 2.0; still current.
Document head elements
{{Anchor|base|base_tag}}{{HTMLElement|base|Base||end=no}}
- Specifies a base URL
In computing, a uniform resource locator or universal resource locator is a specific character string that constitutes a reference to an Internet resource....
for all relative href and other links in the document. Must appear before any element that refers to an external resource. HTML permits only one base element for each document. The base element has attributes, but no contents.
- A development version of BASE is mentioned in HTML Tags; standardized in HTML 2.0; still current.
{{Anchor|basefont|basefont_tag}}{{HTMLElement|basefont|Basefont||end=no|deprecated=1}}
- Specifies a base font size, typeface, and color for the document. Used together with
font elements. DeprecatedIn the process of authoring computer software, its standards or documentation, deprecation is a status applied to software features to indicate that they should be avoided, typically because they have been superseded...
in favor of stylesheets.
- Standardized in HTML 3.2; deprecated in HTML 4.0 Transitional; invalid in HTML 4.0 Strict.
{{Anchor|isindex|isindex_tag}}{{HTMLElement|isindex|Index|end=no|deprecated=1}}
isindex could either appear in the document head or in the body, but only once in a document. See Forms.
{{Anchor|link|link_tag}}{{HTMLElement|link|Link|end=no}}
{{see also|Link relations}}
- Specifies links to other documents, such as previous and next links, or alternate versions. A common use is to link to external stylesheet
Cascading Style Sheets is a style sheet language used to describe the presentation semantics of a document written in a markup language...
s, using the form:
<link rel="stylesheet" type="text/css" href="url" title="description_of_style">
- A less-common, but important, usage is to supply navigation hints consistently through use of microformat
A microformat is a web-based approach to semantic markup which seeks to re-use existing HTML/XHTML tags to convey metadata and other attributes in web pages and other contexts that support HTML, such as RSS...
s. Several common relationships are defined, that may be exposed to users through the browser interface rather than directly in the web page.
<link rel="next" href="url">
- A document’s
head element may contain any number of link elements. The link element has attributes, but no contents.
- LINK existed in HTML Internet Draft 1.2, and was standardized in HTML 2.0; still current.
{{Anchor|meta|meta_tag}}
{{HTMLElementMeta elements are the HTML or XHTML <meta … > element used to provide structured metadata about a Web page. Multiple elements are often used on the same page: the element is the same, but its attributes are different...
{{Main|Meta element}}
- Can be used to specify additional metadata
The term metadata is an ambiguous term which is used for two fundamentally different concepts . Although the expression "data about data" is often used, it does not apply to both in the same way. Structural metadata, the design and specification of data structures, cannot be about data, because at...
about a document, such as its author, publication date, expiration date, page description, keywords, or other information not provided through the other header elements and attributes. Because of their generic nature, meta elements specify associative key-value pairsIn computer science, an associative array is an abstract data type composed of a collection of pairs, such that each possible key appears at most once in the collection....
. In general, a meta element conveys hidden information about the document. Several meta tags can be used, all of which should be nested in the head element. The specific purpose of each meta element is defined by its attributes.
- In one form,
meta elements can specify HTTP headers which should be sent by a web serverWeb server can refer to either the hardware or the software that helps to deliver content that can be accessed through the Internet....
before the actual content, for example:
<meta http-equiv="foo" content="bar">
- — this specifies that the page should be served with an HTTP header called
foo that has a value bar.
- In the general form, a
meta element specifies name and associated content attributes describing aspects of the HTML page. To prevent possible ambiguity, an optional third attribute, scheme, may be supplied to specify a semantic framework that defines the meaning of the key and its value: for example:
<meta name="foo" content="bar" scheme="DC">
- In this example, the
meta element identifies itself as containing the foo element, with a value of bar, from the DC or Dublin CoreThe Dublin Core metadata terms are a set of vocabulary terms which can be used to describe resources for the purposes of discovery. The terms can be used to describe a full range of web resources: video, images, web pages etc and physical resources such as books and objects like artworks...
resource description frameworkThe Resource Description Framework is a family of World Wide Web Consortium specifications originally designed as a metadata data model...
.
- Standardized in HTML 2.0; still current.
{{Anchor|object}}{{XMLElement|object|Object|...}}
- Used for including generic objects within the document header. Though rarely used within a
head element, it could potentially be used to extract foreign data and associate it with the current document.
- Standardized in HTML 4.0; still current.
{{Anchor|script|script_tag}}{{XMLElement|script|Script|...}}
- Can act as a container for script instructions or link to an external script with the optional
src attribute. Also usable in the document body to dynamically generate either both block or inline content.
- Standardized in HTML 3.2; still current.
{{Anchor|style|style_tag}}{{XMLElement|style|Style|...}}
- Specifies a style
Cascading Style Sheets is a style sheet language used to describe the presentation semantics of a document written in a markup language...
for the document, usually in the form:
<style type="text/css"> ... </style>
- Can either act as a container for style instructions or link to external stylesheets – for example, in CSS
Cascading Style Sheets is a style sheet language used to describe the presentation semantics of a document written in a markup language...
, with @import directives of the form:
<style> @import url; </style>
- Standardized in HTML 3.2; still current.
{{Anchor|title|title_tag}}{{XMLElement|title|Title|...}}
- Define a document title. Required in every HTML and XHTML document. User agents may use the title in different ways. For example:
- Web browsers usually display it in a window’s title bar
In computing, the title bar consists of that part of a window where the title of the window appears. Most graphical operating systems and window managers position the title bar at the top of the application window as a horizontal bar....
when the window is open, and (where applicable) in the task bar when the window is minimized.
- It may become the default filename when saving the page.
- Search engine
A search engine is an information retrieval system designed to help find information stored on a computer system. The search results are usually presented in a list and are commonly called hits. Search engines help to minimize the time required to find information and the amount of information...
s’ web crawlerA Web crawler is a computer program that browses the World Wide Web in a methodical, automated manner or in an orderly fashion. Other terms for Web crawlers are ants, automatic indexers, bots, Web spiders, Web robots, or—especially in the FOAF community—Web scutters.This process is called Web...
s may pay particular attention to the words used in the title.
- The
title element must not contain other elements, only text. Only one title element is permitted in a document.
- TITLE existed in HTML Tags, and was standardized in HTML 2.0; still current.
Document body elements
In visual browsers, displayable elements can be rendered as either
block or
inline. While all elements are part of the document sequence, block elements appear within their parent elements:
- as rectangular objects which do not break across lines;
- with block margins, width and height properties which can be set independently of the surrounding elements.
Conversely, inline elements are treated as part of the flow of document text; they cannot have margins, width or height set, and do break across lines.
Basic text
{{Anchor|p|p_tag}}{{XMLElement|p|Paragraph|...}}
- Creates a paragraph, perhaps the most common block level element.
P existed in HTML Tags, and was standardized in HTML 2.0; still current.
{{Anchor|h1|h1_tag}}{{XMLElement|h1|Primary Headline|...}}
{{Anchor|h2|h2_tag}}{{XMLElement|h2|Secondary Headline|...}}
{{Anchor|h3|h3_tag}}{{XMLElement|h3|Third Level Headline|...}}
{{Anchor|h4|h4_tag}}{{XMLElement|h4|4. Level Headline|...}}
{{Anchor|h5|h5_tag}}{{XMLElement|h5|5. Level Headline|...}}
{{Anchor|h6|h6_tag}}{{XMLElement|h6|6. Level Headline|...}}
- Section headings at different levels.
<h1> delimits the highest-level heading, <h2> the next level down (sub-section), <h3> for a level below that, and so on to <h6>.
- Most visual browsers show headings as large bold text by default, though this can be overridden with CSS
Cascading Style Sheets is a style sheet language used to describe the presentation semantics of a document written in a markup language...
. Heading elements are not intended merely for creating large or bold text — they describe the document’s structure and organization. Some programs use them to generate outlines and tables of contents.
- Headings existed in HTML Tags, and were standardized in HTML 2.0; still current.
Lists
{{Anchor|dl|dl_tag}}{{XMLElement|dl|Definition List|...}}
- A definition list (consisting of definition terms paired with definitions).
DL existed in HTML Tags, and was standardized in HTML 2.0; still current.
{{Anchor|dt|dt_tag}}{{XMLElement|dt|Definition Term|...}}
- A definition term in a definition list.
DT existed in HTML Tags, and was standardized in HTML 2.0; still current.
{{Anchor|dd|dd_tag}}{{XMLElement|dd|Definition|...}}
- The definition of a term, in a definition list.
DD existed in HTML Tags, and was standardized in HTML 2.0; still current.
{{Anchor|ol|ol_tag}}{{XMLElement|ol|Ordered List|...}}
- An ordered (enumerated) list. The
type attribute can be used to specify the kind of ordering, but stylesheets give more control: {list-style-type: foo}. The default is Arabic numbering.
OL existed in HTML Internet Draft 1.2, and was standardized in HTML 2.0; still current.
{{Anchor|ul|ul_tag}}{{XMLElement|ul|Unordered List|...}}
- An unordered (bulleted) list. Stylesheets can be used to specify the list marker:
{list-style-type: foo}. The default marker is a disc.
UL existed in HTML Tags, and was standardized in HTML 2.0; still current.
{{Anchor|li|li_tag}}{{XMLElement|li|List Item|...}}
- A list item in ordered (ol) or unordered (ul) lists.
LI existed in HTML Tags, and was standardized in HTML 2.0; still current.
{{Anchor|dir|dir_tag}}{{XMLElement|dir|Directory List|...|deprecated=1}}
- A directory listing. The original purpose of this element was never widely supported; deprecated in favor of
<ul>.
DIR existed in HTML Tags, and was standardized in HTML 2.0; deprecated in HTML 4.0 Transitional; invalid in HTML 4.0 Strict.
Other block elements
{{Anchor|address|address_tag}}{{XMLElement|address|Address|...}}
- Contact information for the document author.
ADDRESS existed in HTML Tags, and was standardized in HTML 2.0; still current.
{{anchor|blockquote}}
{{Anchor|blockquote|blockquote_tag}}{{XMLElement|blockquote|BlockQuotation|...}}
- A block-level quotation
In HTML and XHTML, the blockquote element defines a block quotation within the text. The syntax is <blockquote><p>blockquoted text goes here</p></blockquote>....
, for when the quotation includes block level elements, e.g. paragraphs. The cite attribute may give the source, and must be a fully qualified Uniform Resource IdentifierIn computing, a uniform resource identifier is a string of characters used to identify a name or a resource on the Internet. Such identification enables interaction with representations of the resource over a network using specific protocols...
.
- The default presentation of block quotations in visual browsers is usually to indent them from both margins. This has led to the element being unnecessarily used just to indent paragraphs, regardless of semantics. For quotations not containing block level elements see the quote (
q) element.
BLOCKQUOTE existed in HTML Internet Draft 1.2, and was standardized in HTML 2.0; still current. See blockquote element for more information.
{{Anchor|center|center_tag}}{{XMLElement|center|Centered Text|...|deprecated=1}}
- Creates a block-level center-aligned division. Deprecated in favor of
<div> or another element with centering defined using stylesheets.
- Standardized in HTML 3.2; deprecated in HTML5.
{{Anchor|del|del_tag}}{{XMLElement|del|Deleted Section|...}}
- Marks a deleted section of content. This element can also be used as inline.
- Standardized in HTML 4.0; still current.
{{Anchor|div|div_tag}}{{XMLElement|div|Logical division|...}}
{{Main|Span and div}}
- A block-level logical division. A generic element with no semantic meaning used to distinguish a document section, usually for purposes such as presentation or behavior controlled by stylesheets
Cascading Style Sheets is a style sheet language used to describe the presentation semantics of a document written in a markup language...
or DOMThe Document Object Model is a cross-platform and language-independent convention for representing and interacting with objects in HTML, XHTML and XML documents. Aspects of the DOM may be addressed and manipulated within the syntax of the programming language in use...
calls.
- Proposed in the HTML 3.0 Drafts; Standardized in HTML 3.2; still current.
{{Anchor|hr|hr_tag}}{{HTMLElement|hr|HorizontalRule||end=no}}
- A horizontal rule. Presentational rules can also be drawn with stylesheets.
- Proposed in the HTML 3.0 Drafts; Standardized in HTML 3.2; still current.
{{Anchor|ins|ins_tag}}{{XMLElement|ins|Inserted Section|...}}
- Marks a section of inserted content. This element can also be used as inline.
- Standardized in HTML 4.0; still current.
{{Anchor|noscript|noscript_tag}}{{XMLElement|noscript|Noscript|...}}
- Replacement content for scripts. Unlike script this can only be used as a block-level element.
- Standardized in HTML 4.0; still current.
{{Anchor|pre|pre_tag}}{{XMLElement|pre|PreFormattedText|...}}
- Pre-formatted text. Text within this element is typically displayed in a non-proportional font exactly as it is laid out in the file (see ASCII art
ASCII art is a graphic design technique that uses computers for presentation and consists of pictures pieced together from the 95 printable characters defined by the ASCII Standard from 1963 and ASCII compliant character sets with proprietary extended characters...
). Whereas browsers ignore whitespaceIn computer science, whitespace is any single character or series of characters that represents horizontal or vertical space in typography. When rendered, a whitespace character does not correspond to a visual mark, but typically does occupy an area on a page...
for other HTML elements, in pre, whitespace should be rendered as authored. (With the CSS properties: {white-space: pre; font-family: monospace;}, other elements can be presented in the same way.) This element can contain any inline element except: image (IMG), object (OBJECT), big font size (BIG), small font size (SMALL), superscript (SUP), and subscript (SUB).
PRE existed in HTML Internet Draft 1.2, and was standardized in HTML 2.0; still current.
{{Anchor|script|script_tag}}{{XMLElement|script|Script|...}}
- Places a script in the document. Also usable in the head and in inline contexts.
- Note:
SCRIPT is not itself either a block or inline element; by itself it should not display at all, but it can contain instructions to dynamically generate either both block or inline content.
- Standardized in HTML 3.2; still current.
Inline elements
Inline elements cannot be placed directly inside the
body element; they must be wholly nested within block-level elements.
Anchor
{{Anchor|a|a_tag}}{{XMLElement|a|Anchor|...}}
- An anchor element is called an anchor because web designers can use it to anchor a URL to some text on a web page. When users view the web page in a browser, they can click the text to activate the link and visit the page whose URL is in the link.
- In HTML, an anchor can be either the origin or the target (destination) end of a hyperlink
In computing, a hyperlink is a reference to data that the reader can directly follow, or that is followed automatically. A hyperlink points to a whole document or to a specific element within a document. Hypertext is text with hyperlinks...
.
- With the attribute
href (hypertext reference http://www.w3.org/Provider/ServerWriter.html), the anchor becomes a hyperlink to either another part of the document or another resource (e.g. a webpage) using an external URLIn computing, a uniform resource locator or universal resource locator is a specific character string that constitutes a reference to an Internet resource....
.
- Alternatively (and sometimes concurrently), with the
name or id attributes set, the element becomes a target. A Uniform Resource LocatorIn computing, a uniform resource locator or universal resource locator is a specific character string that constitutes a reference to an Internet resource....
can link to this target via a fragment identifierIn computer hypertext, a fragment identifier is a short string of characters that refers to a resource that is subordinate to another, primary resource...
. Any element can now be made into an anchor by using the id attribute,http://www.w3.org/TR/html4/struct/links.html#h-12.2.3 so using <a name="foo"> is not necessary.
- The attribute
title may be set to give brief information about the link:
<a href="URL" title="additional information">link text</a>
- In most graphical browsers, when the cursor hovers over a link, it typically changes into a hand with a stretched index finger, and the
title appears in some way (varies according to browser). Some browsers render alt textThe alt attribute is used in HTML and XHTML documents to specify alternative text that is to be rendered when the element to which it is applied cannot be rendered. In HTML 4.01, the attribute is required for the img and area tags...
the same way, though this is technically incorrect.
A existed in HTML Tags, and was standardized in HTML 2.0; still current.
General
{{Anchor|abbr|abbr_tag}}{{XMLElement|abbr|Abbreviation|...}}
- Marks an abbreviation
An abbreviation is a shortened form of a word or phrase. Usually, but not always, it consists of a letter or group of letters taken from the word or phrase...
, and can make the full form available:
<abbr title="abbreviation">abbr.</abbr>
- Standardized in HTML 4.0; still current.
{{Anchor|acronym|acronym_tag}}{{XMLElement|acronym|Acronym|...|deprecated=1}}
- Similar to the
abbr element, but marks an acronym:
<acronym title="Hyper-Text Markup Language">HTML</acronym>
- Standardized in HTML 4.0; still current, not supported in HTML5.
{{Anchor|dfn|dfn_tag}}{{XMLElement|dfn|Definition|...}}
- Inline definition of a single term.
DFN existed in HTML Internet Draft 1.2, and was fully standardized in HTML 3.2; still current.
{{Anchor|em|em_tag}}{{XMLElement|em|Emphasis|...}}
- Emphasis (conventionally displayed in italics)
EM existed in HTML Internet Draft 1.2, and was standardized in HTML 2.0; still current.
{{Anchor|strong|strong_tag}}{{XMLElement|strong|Strong Emphasis|...}}
- strong emphasis (conventionally displayed bold).
- An aural user agent
A voice browser is a web browser that presents an interactive voice user interface to the user. In addition, it typically provides an interface to the PSTN or a PBX. Just as a visual web browser works with HTML pages, a voice browser operates on pages that specify voice dialogues...
may use different voices for emphasis.
STRONG existed in HTML Internet Draft 1.2, and was standardized in HTML 2.0; still current.
Computer phrase elements
These elements are useful primarily for documenting computer code development and user interaction through differentiation of source code (<code>), source code variables (<var>), user input (<kbd>), and terminal output (<samp>).
{{Anchor|code|code_tag}}{{XMLElement|code|Sourcecode|...}}
- A code snippet. Conventionally rendered in a monospace font:
Code snippet.
CODE existed in HTML Internet Draft 1.2, and was standardized in HTML 2.0; still current.
{{Anchor|samp|samp_tag}}{{XMLElement|samp|Sample|...}}
- Sample output (from a program or script)
SAMP existed in HTML Internet Draft 1.2, and was standardized in HTML 2.0; still current.
{{Anchor|kbd|kbd_tag}}{{XMLElement|kbd|Keyboard|...}}
- Keyboard - text to be entered by the user
KBD existed in HTML Internet Draft 1.2, and was standardized in HTML 2.0; still current.
{{Anchor|var|var_tag}}{{XMLElement|var|Variable|...}}
- Variable
VAR existed in HTML Internet Draft 1.2, and was standardized in HTML 2.0; still current.
Presentation
As visual presentational markup only applies directly to visual browsers, its use is discouraged. Stylesheets should be used instead. Several of these elements are deprecated or invalid in HTML 4 / XHTML 1.0, and the remainder are invalid in the current draft of
XHTML 2.0. The current draft of
HTML 5, however, includes
<b>,
<i>, and
<small>.
{{Anchor|b|b_tag}}{{XMLElement|b|Bold|...}}
- Sets font to boldface where possible. (Equivalent CSS:
{font-weight: bold}.) <strong>...</strong> usually has the same effect in visual browsers, as well as having more semantic meaning.
B existed in HTML Internet Draft 1.2, and was standardized in HTML 2.0; still current.
{{Anchor|i|i_tag}}{{XMLElement|i|Italic|...}}
- Sets font to italic where possible. (Equivalent CSS:
{font-style: italic}.) <em>...</em> usually has the same effect in visual browsers, as well as having more semantic meaning.
I existed in HTML Internet Draft 1.2, and was standardized in HTML 2.0; still current.
{{Anchor|big|big_tag}}{{XMLElement|big|Big|...|deprecated=1}}
- Increases font size (bigger text). Equivalent CSS:
{font-size: larger}
- Standardized in HTML 3.2; still current, not supported in HTML5.
{{Anchor|small|small_tag}}{{XMLElement|small|Small|...}}
- Decreases font size (smaller text). Equivalent CSS:
{font-size: smaller}
- Standardized in HTML 3.2; still current.
{{Anchor|strike|strike_tag}}{{XMLElement|strike|Strikethrough|...|deprecated=1}} and {{XMLElement|s|Strikethrough|...|deprecated=1}}
- Strike-through text (
Strikethrough), (Equivalent CSS: {text-decoration: line-through})
STRIKE was standardized in HTML 3.2; deprecated in HTML 4.0 Transitional; invalid in HTML 4.0 Strict.
S is deprecated in HTML 4.0 Transitional (having not appeared in any previous standard), and is invalid in HTML 4.0 Strict.
{{Anchor|tt|tt_tag}}{{XMLElement|tt|Teletype|...}}
- Fixed-width font (typewriter-like), also known as teletype. (Equivalent CSS:
{font-family: monospace;})
TT existed in HTML Internet Draft 1.2, and was standardized in HTML 2.0; still current.
{{Anchor|u|u_tag}}{{XMLElement|u|Underlined|...|deprecated=1}}
- Underlines text. (Equivalent CSS:
{text-decoration: underline})
U existed in HTML Internet Draft 1.2, was standardized in HTML 3.2 but was deprecated in HTML 4.0 Transitional and is invalid in HTML 4.0 Strict.
{{Anchor|font|font_tag}}{{XMLElement|font|Teletype|...|deprecated=1}}
<font [color=color] [size=size] [face=face]>...</font>
- Can specify the font color with the
color attribute, typeface with the face attribute, and absolute or relative size with the size attribute.
- Examples (all uses are deprecated, use CSS equivalents if possible):
-
<font color="green">text</font> creates green text.
-
<font color="#114499">text</font> creates text with hexadecimal color #114499.
-
<font size="4">text</font> creates text with size 4. Sizes are from 1 to 7. The standard size is 3, unless otherwise specified in the <body> or other tags.
-
<font size="+1">text</font> creates text with size 1 bigger than the standard. <font size="-1">text</font> is opposite.
-
<font face="Courier">text</font> makes text with Courier font.
- Equivalent CSS for font attributes:
<font size="N"> corresponds to {font-size: Yunits} (the HTML specification does not define the relationship between size N and unit-size Y, nor does it define a unit).
<font color="red"> corresponds to {color: red}
<font face="Courier"> corresponds to {font-family: "Courier"}
- Standardized in HTML 3.2; deprecated in HTML 4.0 Transitional; invalid in HTML 4.0 Strict.
Span
{{Anchor|span|span_tag}}{{XMLElement|span|Span|...|}}
{{Main|Span and div}}
- An inline logical division. A generic element with no semantic meaning used to distinguish a document section, usually for purposes such as presentation or behavior controlled by stylesheets
Cascading Style Sheets is a style sheet language used to describe the presentation semantics of a document written in a markup language...
or DOMThe Document Object Model is a cross-platform and language-independent convention for representing and interacting with objects in HTML, XHTML and XML documents. Aspects of the DOM may be addressed and manipulated within the syntax of the programming language in use...
calls.
- Standardized in HTML 4.0; still current.
Other inline elements
{{Anchor|br|br_tag}}{{HTMLElement|br|Line Break|end=no}}
- A forced line-break.
- Standardized in HTML 2.0; still current.
{{Anchor|bdo|bdo_tag}}{{XMLElement|bdo|Bidirectional Override|...|}}
- Marks an inline section of text in which the reading direction is the opposite from that of the parent element.
- Standardized in HTML 4.0; still current.
{{Anchor|cite|cite_tag}}{{XMLElement|cite|Citation|...}}
- A citation. Reference for a quote or statement in the document.
- CITE existed in HTML Internet Draft 1.2, and was standardized in HTML 2.0; still current.
{{Anchor|del|del_tag}}{{XMLElement|del|Deleted|...}}
- Deleted text. Typically rendered as a strikethrough
Strikethrough is a typographical presentation of words with a horizontal line through their center. This is an example....
: Deleted text.
- Standardized in HTML 4.0; still current.
{{Anchor|ins|ins_tag}}{{XMLElement|ins|Inserted|...}}
- Inserted text. Often used to mark up replacement text for
<del>'d text. Typically rendered underlineAn underline, also called an underscore, is one or more horizontal lines immediately below a portion of writing. Single, and occasionally double , underlining was originally used in hand-written or typewritten documents to emphasise text...
d: Inserted text.
- Standardized in HTML 4.0; still current.
-
- Note, both
<ins> and <del> elements may also be used as block elements: containing other block and inline elements. However, these elements must still remain wholly within their parent element to maintain a well-formed HTML document. For example deleting text from the middle of one paragraph across several other paragraphs and ending in a final paragraph would need to use three separate <del> elements. Two <del> elements would be required as inline element to indicate the deletion of text in the first and last paragraphs, and a third, used as a block element, to indicate the deletion in the intervening paragraphs.
{{Anchor|q|q_tag}}{{XMLElement|q|Quote|...}}
- An inline quotation (for block level quotation see
BLOCKQUOTE). Quote elements may be nested.
<q> should automatically generate quotation marks in conjunction with Stylesheets. Practical concerns due to browser non-compliance may force authors to find work-arounds.
- The
cite attribute gives the source, and must be a fully qualified URIIn computing, a uniform resource identifier is a string of characters used to identify a name or a resource on the Internet. Such identification enables interaction with representations of the resource over a network using specific protocols...
.
- Standardized in HTML 4.0; still current.
- Note: Lengthy inline quotations may be displayed as indented blocks (as
blockquote) using stylesheets. For example, with a suitable CSS rule associated with q.lengthy:
<q class="lengthy">An inline quotation of significant length (say 25 words, for example) goes here...</q>
{{Anchor|script|script_tag}}{{XMLElement|script|Script|...}}
- Places a script
A scripting language, script language, or extension language is a programming language that allows control of one or more applications. "Scripts" are distinct from the core code of the application, as they are usually written in a different language and are often created or at least modified by the...
in the document. Also usable in the head and in block contexts.
- Note:
<script> is not itself either a block or inline element; by itself it should not display at all, but it can contain instructions to dynamically generate either both block or inline content.
- Standardized in HTML 3.2; still current.
{{Anchor|sub|sub_tag}}{{XMLElement|sub|Subscript|...}} and {{XMLElement|sup|Superscript|...}}
- Mark subscript or superscript text. (Equivalent CSS:
{vertical-align: sub} or {vertical-align: super}.)
- Both were proposed in the HTML 3.0 Drafts; Standardized in HTML 3.2; still current.
{{Anchor|wbr|wbr_tag}}{{HTMLElement|wbr|Optional line break|end=no}}
- An optional line break.
- Was widely used (and supported by all major browsers) for years despite being non-standard until finally being standardized in HTML 5.
Images and objects
{{Anchor|applet|applet_tag}}{{XMLElement|applet|Java Applet|...|deprecated=xhtml}}
- Embeds a Java applet
A Java applet is an applet delivered to users in the form of Java bytecode. Java applets can run in a Web browser using a Java Virtual Machine , or in Sun's AppletViewer, a stand-alone tool for testing applets...
in the page. Deprecated in favour of <object>, as it could only be used with Java applets, and had accessibility limitations.
- Standardized in HTML 3.2; deprecated in HTML 4.0 Transitional; invalid in HTML 4.0 Strict. As of 2011, still widely used as the implementations of the replacing
<object> are not consistent between different browsers.
{{Anchor|area|area_tag}}{{HTMLElement|area|Area|end=no}}
- Specifies a focusable
In computing, the focus indicates the component of the graphical user interface which is currently selected to receive input. Text entered at the keyboard or pasted from a clipboard is sent to the component which currently has the focus. Moving the focus away from a specific user interface element...
area in a map.
- Standardized in HTML 3.2; still current.
{{Anchor|img|img_tag}}{{HTMLElement|img|Image|end=no}}
- Used by visual user agents to insert an image
An image is an artifact, for example a two-dimensional picture, that has a similar appearance to some subject—usually a physical object or a person.-Characteristics:...
in the document. The src attribute specifies the image URL. The required alt attributeThe alt attribute is used in HTML and XHTML documents to specify alternative text that is to be rendered when the element to which it is applied cannot be rendered. In HTML 4.01, the attribute is required for the img and area tags...
provides alternative text in case the image cannot be displayed. (Though alt is intended as alternative text, Microsoft Internet ExplorerWindows Internet Explorer is a series of graphical web browsers developed by Microsoft and included as part of the Microsoft Windows line of operating systems, starting in 1995. It was first released as part of the add-on package Plus! for Windows 95 that year...
7 and below render it as a tooltipThe tooltip or infotip is a common graphical user interface element. It is used in conjunction with a cursor, usually a mouse pointer. The user hovers the cursor over an item, without clicking it, and a tooltip may appear—a small "hover box" with information about the item being hovered...
if no title is given. SafariSafari is a web browser developed by Apple Inc. and included with the Mac OS X and iOS operating systems. First released as a public beta on January 7, 2003 on the company's Mac OS X operating system, it became Apple's default browser beginning with Mac OS X v10.3 "Panther". Safari is also the...
and Google ChromeGoogle Chrome is a web browser developed by Google that uses the WebKit layout engine. It was first released as a beta version for Microsoft Windows on September 2, 2008, and the public stable release was on December 11, 2008. The name is derived from the graphical user interface frame, or...
, on the other hand, do not display the alt attribute at all.) img was proposed by Marc AndreessenMarc Andreessen is an American entrepreneur, investor, software engineer, and multi-millionaire best known as co-author of Mosaic, the first widely-used web browser, and co-founder of Netscape Communications Corporation. He founded and later sold the software company Opsware to Hewlett-Packard...
and implemented in the NSCA MosaicMosaic is the web browser credited with popularizing the World Wide Web. It was also a client for earlier protocols such as FTP, NNTP, and gopher. Its clean, easily understood user interface, reliability, Windows port and simple installation all contributed to making it the application that opened...
web browser.
- IMG existed in HTML Internet Draft 1.2, and was standardized in HTML 2.0; still current.
{{Anchor|map|map_tag}}{{XMLElement|map|Image Map|...|}}
- Specifies a client-side image map
In HTML and XHTML , an image map is a list of coordinates relating to a specific image, created in order to hyperlink areas of the image to various destinations . For example, a map of the world may have each country hyperlinked to further information about that country...
.
- Standardized in HTML 3.2; still current.
{{Anchor|object|object_tag}}{{XMLElement|object|Object|...|}}
- Includes an object
"Media Object" is a portion of one or more elements that may contain video, images, and/or audio. The primary purpose of the Media Object is to provide a wrapper around a set of alternative presentations of the same information....
in the page of the type specified by the type attribute. This may be in any MIMEMultipurpose Internet Mail Extensions is an Internet standard that extends the format of email to support:* Text in character sets other than ASCII* Non-text attachments* Message bodies with multiple parts...
-type the user agent understands, such as an embedded HTML page, a file to be handled by a plug-in such as Flash, a JavaJava is a programming language originally developed by James Gosling at Sun Microsystems and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities...
appletIn computing, an applet is any small application that performs one specific task that runs within the scope of a larger program, often as a plug-in. An applet typically also refers to Java applets, i.e., programs written in the Java programming language that are included in a web page...
, a sound file, etc.
- Standardized in HTML 4.0; still current.
{{Anchor|param|param_tag}}{{HTMLElement|param|Object Parameter|...|end=no}}
- Originally introduced with applet, this element is now used with, and should only occur as a child of object. It uses attributes to set a parameter for the object, e.g. width, height, font, background color, etc., depending on the type of object. An object can have multiple params.
- Standardized in HTML 3.2; still current.
Forms
{{Main|HTML form}}
These elements can be combined into a form or in some instances used separately as user-interface controls; in the document, they can be simple HTML or used in conjunction with Scripts. HTML markup specifies the elements that make up a form, and the method by which it will be submitted. However, some form of scripts (server-side, client-side, or both) must be used to process the user’s input once it is submitted.
(These elements are either block or inline elements, but are collected here as their use is more restricted than other inline or block elements.)
{{Anchor|form|form_tag}}{{XMLElement|form|Form|...|atr={{XMLAttribute|action|Action|url|type=URL|need=required}}}}
- Creates a form
A webform on a web page allows a user to enter data that is sent to a server for processing. Webforms resemble paper or database forms because internet users fill out the forms using checkboxes, radio buttons, or text fields...
. The form element specifies and operates the overall action of a form area, using the required action attribute.
- Standardized in HTML 2.0; still current.
{{Anchor|button|button_tag}}{{XMLElement|button|Button|...}}
- A generic form button which can contain a range of other elements to create complex buttons.
- Standardized in HTML 4.0; still current.
{{Anchor|fieldset|fieldset_tag}}{{XMLElement|fieldset|Fieldset|...}}
- A container for adding structure to forms. For example, a series of related controls can be grouped within a fieldset, which can then have a legend added in order to identify their function.
- Standardized in HTML 4.0; still current.
{{Anchor|input|input_tag}}{{HTMLElement|input|Input|...|end=no}}
- input elements allow a variety of standard form controls to be implemented.
- Standardized in HTML 2.0; still current.
- Input Types:
- {{XMLAttribute|type|Field Type|checkbox|type=ENUM|need=implied}}
- A checkbox. Can be checked or unchecked.
- {{XMLAttribute|type|Field Type|radio|type=ENUM|need=implied}}
- A radio button
A radio button or option button is a type of graphical user interface element that allows the user to choose only one of a predefined set of options....
. If multiple radio buttons are given the same name, the user will only be able to select one of them from this group.
- {{XMLAttribute|type|Field Type|button|type=ENUM|need=implied}}
- A general-purpose button. The element
<button> is preferred if possible (i.e. if the client supports it) as it provides richer possibilities.
- {{XMLAttribute|type|Field Type|submit|type=ENUM|need=implied}}
- A submit button.
- {{XMLAttribute|type|Field Type|image|type=ENUM|need=implied}}
- An image button. The image URL may be specified with the
src attribute.
- {{XMLAttribute|type|Field Type|reset|type=ENUM|need=implied}}
- A reset button for resetting the form to default values.
- {{XMLAttribute|type|Field Type|text|type=ENUM|need=optional}}
- A one-line text input field. The
size attribute specifies the default width of the input in character-widths. maxlength sets the maximum number of characters the user can enter (which may be greater than size).
- {{XMLAttribute|type|Field Type|password|type=ENUM|need=implied}}
- A variation of text. The difference is that text typed in this field is masked — characters are displayed as an asterisk, a dot or another replacement. It should be noted, however, that the password is still submitted to the server as clear text, so an underlying secure transport layer like HTTPS
Hypertext Transfer Protocol Secure is a combination of the Hypertext Transfer Protocol with SSL/TLS protocol to provide encrypted communication and secure identification of a network web server...
is needed if confidentiality is a concern.
- {{XMLAttribute|type|Field Type|file|type=ENUM|need=implied}}
- A file select
In HTML, a file-select control is a component of a web form with which a user can select a file from his local machine. When the form is submitted , the file is uploaded to the web server. There, when the file arrives, some action usually takes place, such as saving the file on the web server...
field (for uploading files to a server).
- {{XMLAttribute|type|Field Type|hidden|type=ENUM|need=implied}}
- hidden inputs are not visible in the rendered page, but allow a designer to maintain a copy of data that needs to be submitted to the server as part of the form. This may, for example, be data that this web user entered or selected on a previous form that needs to be processed in conjunction with the current form.
{{Anchor|isindex|isindex_tag}}{{HTMLElement|isindex|Index|end=no|deprecated=1}}
isindex could either appear in the document head or in the body, but only once in a document.
- Isindex operated as a primitive HTML search form; but was de-facto obsoleted by more advanced HTML forms introduced in the early to mid-1990s. Represents a set of hyperlinks composed of a base URI, an ampersand
An ampersand is a logogram representing the conjunction word "and". The symbol is a ligature of the letters in et, Latin for "and".-Etymology:...
and percent-encodedPercent-encoding, also known as URL encoding, is a mechanism for encoding information in a Uniform Resource Identifier under certain circumstances. Although it is known as URL encoding it is, in fact, used more generally within the main Uniform Resource Identifier set, which includes both Uniform...
keywords separated by plus signs.
- ISINDEX existed in HTML Tags; standardized in HTML 2.0; deprecated in HTML 4.0 Transitional; invalid in HTML 4.0 Strict.
{{Anchor|label|label_tag}}{{XMLElement|label|Label|...|atr={{XMLAttribute|for|For|id|type=ENUM|need=implied}}}}
- Creates a label for a form input (e.g. radio button). Clicking on the label fires a click on the matching input.
- Standardized in HTML 4.0; still current.
{{Anchor|legend|legend_tag}}{{XMLElement|legend|Legend|...}}
- A legend (caption) for a fieldset.
- Standardized in HTML 4.0; still current.
{{Anchor|option|option_tag}}{{HTMLElement|option|Selection Option|...|atr={{XMLAttribute|value|Value|x|type=ANY|need=required}}|end=no}}
- Creates an item in a
select list.
- Standardized in HTML 2.0; still current.
{{Anchor|optgroup|optgroup_tag}}{{HTMLElement|optgroup|Options Group|...}}
- Identifies a group of options in a select list.
- Standardized in HTML 4.0; still current.
{{Anchor|select|select_tag}}{{XMLElement|select|Selection List|...|atr={{XMLAttribute|name|Name|xyz|type=NMTOKEN|need=implied}}}}
- Creates a selection list, from which the user can select a single option. May be rendered as a dropdown list.
- Standardized in HTML 2.0; still current.
{{Anchor|textarea|textarea_tag}}{{XMLElement|textarea|Multiline Textarea|...|atr={{XMLAttribute|rows|Rows|8|type=INT}}}}
- A multiple-line text area, the size of which is specified by
cols (where a col is a one-character width of text) and rows attributes. The content of this element is restricted to plain text, which appears in the text area as default text when the page is loaded.
- Standardized in HTML 2.0; still current.
Tables
The format of HTML Tables was proposed in the HTML 3.0 Drafts and the later RFC 1942
HTML Tables. They were inspired on the
CALS Table ModelThe CALS Table Model is a standard for representing tables in SGML/XML. It was developed as part of the CALS DOD initiative.-History and Rationale:...
. Some elements in these proposals were included in HTML 3.2; the present form of HTML Tables was standardized in HTML 4. (Many of the elements used within tables are neither
block nor
inline elements.)
{{Anchor|table|table_tag}}{{HTML element|name=table|tags=all|content=...}}
- Identifies a table. Several attributes are possible in HTML Transitional, but most of these are invalid in HTML Strict and can be replaced with stylesheets. The summary attribute is however informally required for accessibility purposes, though its usage is not simple.
- Proposed in the HTML 3.0 Drafts; Standardized in HTML 3.2; still current.
{{Anchor|tr|tr_tag}}{{HTML element|name=tr|tags=end|content=...}}
- Contains a row of cells in a table.
- Proposed in the HTML 3.0 Drafts; Standardized in HTML 3.2; still current.
{{Anchor|th|th_tag}}{{HTML element|name=th|tags=end|content=...}}
- A table header cell; contents are conventionally displayed bold and centered. An aural user agent may use a louder voice for these items.
- Proposed in the HTML 3.0 Drafts; Standardized in HTML 3.2; still current.
{{Anchor|td|td_tag}}{{HTML element|name=td|tags=end|content=...}}
- A table data cell.
- Proposed in the HTML 3.0 Drafts; Standardized in HTML 3.2; still current.
{{Anchor|colgroup|colgroup_tag}}{{HTML element|name=colgroup|tags=neither|content=...}}
- Specifies a column group in a table.
- Proposed in HTML Tables; Standardized in HTML 4.0; still current.
{{Anchor|col|col_tag}}{{HTML element|name=col|tags=void}}
- Specifies a column in a table.
- Proposed in HTML Tables; Standardized in HTML 4.0; still current.
{{Anchor|caption|caption_tag}}{{HTML element|name=caption|tags=all|content=...}}
- Specifies a caption for a table.
- Proposed in the HTML 3.0 Drafts; Standardized in HTML 3.2; still current.
{{Anchor|thead|thead_tag}}{{HTML element|name=thead|tags=end|content=...}}
- Specifies the header part of a table. This section may be repeated by the user agent if the table is split across pages (in printing or other paged media).
- Proposed in HTML Tables; Standardized in HTML 4.0; still current.
{{Anchor|tbody|tbody_tag}}{{HTML element|name=tbody|tags=neither|content=...}}
- Specifies a body of data for the table.
- Proposed in HTML Tables; Standardized in HTML 4.0; still current.
{{Anchor|tfoot|tfoot_tag}}{{HTML element|name=tfoot|tags=end|content=...}}
- Specifies the footer part of a table. Like
, this section may be repeated by the user agent if the table is split across pages (in printing or other paged media).
- Proposed in HTML Tables; Standardized in HTML 4.0; still current.
Frames
{{Redirect|iframe||IFrame (disambiguation)}}
{{Main|Framing (World Wide Web)}}
Frames allow a visual HTML Browser window to be split into segments, each of which can show a different document. This can lower bandwidth use, as repeating parts of a layout can be used in one frame, while variable content is displayed in another. This comes at a significant usability cost, especially in non-visual user agents. Because of this cost, frames (excluding the iframe element) are only allowed in HTML 4.01 Frameset.
In HTML 4.01, a document may contain a head and a body or a head and a frameset, but not both a body and a frameset. However, iframe can be used in a normal document body.
{{Anchor|frameset|frameset_tag}}{{HTML element|name=frameset|tags=all|content=...}}
- Contains the frameset. The frames layout is given by comma separated lists in the
rows and cols attributes.
- Standardized in HTML 4.0 Frameset, obsolete in HTML 5.
{{Anchor|frame|frame_tag}}{{HTML element|name=frame|tags=void}}
- Delimits a single frame, or region, within the
frameset. A separate document linked with the src attribute appears inside.
- Standardized in HTML 4.0 Frameset, obsolete in HTML 5.
{{Anchor|noframes|noframes_tag}}{{HTML element|name=noframes|tags=all|content=...}}
- Contains normal HTML content for user agents that don't support frames.
- Standardized in HTML 4.0 Transitional, obsolete in HTML 5.
{{Anchor|iframe|iframe_tag}}{{HTML element|name=iframe|tags=all|content=...}}
- An inline frame places another HTML document in a frame. Unlike an
object element, an inline frame can be the "target" frame for links defined by other elements and it can be selected by the user agent as the focus for printing, viewing its source, etc.
- The content of the element is used as alternative text to be displayed if the browser does not support iframes.
- First introduced by Microsoft Internet Explorer in 1997, standardized in HTML 4.0 Transitional, allowed in HTML 5.
longdesc
In HTMLHyperText Markup Language is the predominant markup language for web pages. HTML elements are the basic building-blocks of webpages....
, longdesc is an attribute used within the image element, frame element, or iframe elementiFrame can be:* I-frames, in video compression; see video compression picture types* iFrame * The HTML iframe element....
. It is used to reference a long description website of the image, frame, or iframe in question.
Longdesc was designed to be used by screen readerA screen reader is a software application that attempts to identify and interpret what is being displayed on the screen . This interpretation is then re-presented to the user with text-to-speech, sound icons, or a Braille output device...
s to display image information for computer users with accessibilityAccessibility is a general term used to describe the degree to which a product, device, service, or environment is available to as many people as possible. Accessibility can be viewed as the "ability to access" and benefit from some system or entity...
issues, such as the blind or visually impaired, and is widely implemented by both web browsers and screen readers. Some developers object that
it is actually seldom used for this purpose, because there are relatively few authors who use the attribute, and most of those authors use it incorrectly, and have used this argument to recommend dropping longdesc. The publishing industry has responded, advocating the retention of longdesc.
Example

Content of description.html:
...
This is an image of a two-layered birthday cake.
...
Linking to the long description in the text
Since very few Graphical browsers support making the link available natively (Opera and iCab being the exceptions), it is useful to include a link to the description page near the img element whenever possible, as this can also aid sighted users.
Example
[
"description.html" title="long description of the image">D]
Historic elements
{{Main|Comparison of layout engines (Non-standard HTML)}}
The following elements were part of the early HTML developed by Tim Berners-LeeSir Timothy John "Tim" Berners-Lee, , also known as "TimBL", is a British computer scientist, MIT professor and the inventor of the World Wide Web...
from 1989–91; they are mentioned in HTML Tags, but deprecated in HTML 2.0 and were never part of HTML standards.
{{Anchor|listing|listing_tag}}{{HTML element|name=listing|tags=all|content=...|obsolete=yes}}
<plaintext> (obsolete)
{{Anchor|xmp|xmp_tag}}{{HTML element|name=xmp|tags=all|content=...|obsolete=yes}}
- These elements were used to show fixed-width text; their use was replaced by
pre.
plaintext cannot have an end tag – it terminates the markup and causes the rest of the document to be parsed as if it were plain textIn computing, plain text is the contents of an ordinary sequential file readable as textual material without much processing, usually opposed to formatted text....
.
- These existed in HTML Tags; deprecated in HTML 2.0; invalid in HTML 4.0.
{{Anchor|nextid|nextid_tag}}{{HTML element|name=nextid|tags=all|content=...|obsolete=yes}}
- This element related to the original NeXT http server, and was not used once the web had spread to other systems.
nextid existed in HTML Tags (described as obsolete); deprecated in HTML 2.0; invalid in HTML 3.2 and later.
Non-standard elements
{{Main|Comparison of layout engines (Non-standard HTML)}}
This section lists some widely-used obsolete elements, which means they are not allowed to be used. They may not be supported in all user agents.
{{Anchor|blink}}{{HTML element|name=blink|link=Blink element|tags=all|content=...|obsolete=yes}}
- Causes text to blink. Can be done with CSS where supported:
{text-decoration: blink} (This effect may have negative consequences for people with photosensitive epilepsyPhotosensitive epilepsy is a form of epilepsy in which seizures are triggered by visual stimuli that form patterns in time or space, such as flashing lights, bold, regular patterns, or regular moving patterns.-Symptoms:...
; its use on the public Internet should follow the appropriate guidelines.)
{{Anchor|marquee}}{{HTML element|name=marquee|link=Marquee element|tags=all|content=...}}
- Creates scrolling text. Can be done with scripting. (This effect may have negative consequences for people with photosensitive epilepsy
Photosensitive epilepsy is a form of epilepsy in which seizures are triggered by visual stimuli that form patterns in time or space, such as flashing lights, bold, regular patterns, or regular moving patterns.-Symptoms:...
; its use on the public Internet should follow the appropriate guidelines.) There are three options, including Alternate, Scroll and slide. Scrolldelay can also be added.
{{Anchor|nobr}}{{HTML element|name=nobr|tags=all|content=...|obsolete=yes}}
- Causes text to not break at end of line. Can be done with CSS:
{white-space: nowrap;}
{{Anchor|noembed}}{{HTML element|name=noembed|tags=all|content=...|obsolete=yes}}
- Specifies alternative content, if the embed cannot be rendered. Replaced by the content of the
embed or object element.
Previously obsolete but added back in HTML 5
{{Anchor|embed}}{{HTML element|name=embed|tags=all|content=...}}
- Inserts a non-standard object (like applet) or external content (typically non-HTML) into the document. Deprecated in HTML 4 in favor of the
object tag, but then was added back into the HTML 5 specification
{{Anchor|menu|menu_tag}}{{HTML element|name=menu|tags=all|content=...}}
- A menu listing. Should be more compact than a
<ul> list.
MENU existed in HTML Tags, and was standardized in HTML 2.0; deprecated in HTML 4.0 Transitional; invalid in HTML 4.0 Strict; but then redefined in HTML 5.
Comments
<!-- A Comment -->
- A comment
In computer programming, a comment is a programming language construct used to embed programmer-readable annotations in the source code of a computer program. Those annotations are potentially significant to programmers but typically ignorable to compilers and interpreters. Comments are usually...
can appear anywhere in a document, even before the doctype, but not in other tags. (However, placing comments – or indeed any characters except for whitespace – before the doctype will cause Internet Explorer 6 to use quirks modeIn computing, quirks mode refers to a technique used by some web browsers for the sake of maintaining backward compatibility with web pages designed for older browsers, instead of strictly complying with W3C and IETF standards in standards mode....
for the document.) None of its enclosed contents are processed. For compatibility with some pre-1995 browsers, the contents of style and script elements are still sometimes surrounded by comment delimiters.
- Comments do not nest: the markup
<!--Xbegin<!--Y-->Xend--> will yield the comment Xbegin<!--Y and the text Xend--> after it.
HTML standards
HTML 2.0:
- {{cite web
| author = Berners-Lee, T., and Connolly, D.
| title = Hypertext Markup Language - 2.0 (RFC 1866)
| publisher = IETF
| date = November 1995
| url = http://tools.ietf.org/html/rfc1866
| accessdate = 2009-03-24}}
HTML 3.2:
- {{cite web
| last = Raggett
| first = Dave
| authorlink = Dave Raggett
| title = HTML 3.2 Reference Specification
| publisher = W3C
| date = 1997-01-14
| url = http://www.w3.org/TR/REC-html32-19970114
| accessdate = 2009-03-27}}
HTML 4.01:
- {{cite web
| first1 = Dave
| last1 = Raggett
| last2 = Le Hors
| first2 = A
| last3 = Jacobs
| first3= I.
| title = HTML 4.01 Specification
| publisher = W3C
| date = 1999-12-24
| url = http://www.w3.org/TR/1999/REC-html401-19991224/
| accessdate = 2009-03-24}} (HTML 4.01 is the updated form of HTML 4.0.)
XHTML 1.0:
- {{cite web
| author = W3C
| title = XHTML 1.0: The Extensible HyperText Markup Language (Second Edition)
| publisher = W3C
| date = 2000-01-26
| url = http://www.w3.org/TR/2002/REC-xhtml1-20020801
| accessdate = 2009-03-24}}
XHTML 1.1:
- {{cite web
| author = Altheim, M., and McCarron, S. (editors)
| title = XHTML 1.1 - Module-based XHTML
| publisher = W3C
| date = 2001-05-31
| url = http://www.w3.org/TR/2001/REC-xhtml11-20010531/
| accessdate = 2009-03-25}}
Other sources
HTML Tags:
- {{cite web
| author = Berners-Lee, T.
| title = HTML Tags
| date = 1992-11-03
| url = http://www.w3.org/History/19921103-hypertext/hypertext/WWW/MarkUp/Tags.html
| accessdate = 2009-03-28}} (Part of the first published description of HTML.)
HTML Internet Draft 1.2:
- {{cite web
| author = Berners-Lee, T., and Connolly, D.
| title = Hypertext Markup Language (HTML)
| date = June 1993
| url = http://www.w3.org/MarkUp/draft-ietf-iiir-html-01.txt
| format = text
| accessdate = 2009-03-28}}
HTML 3.0 Drafts:
- {{cite web
| last = Raggett
| first = Dave
| title = HyperText Markup Language Specification Version 3.0 (draft)
| date = 1995-03-24
| url = http://www.w3.org/MarkUp/html3/CoverPage.html
| accessdate = 2009-04-18}} (This is the final draft of HTML 3.0, which expired without being developed further.)
HTML Tables:
- {{cite web
| first = Dave
| last = Raggett
| title = HTML Tables
| work = RFC 1942
| publisher = IETF
| date = May 1996
| url = http://tools.ietf.org/html/rfc1942
| accessdate = 2009-03-22}}
XML 1.0:
- {{cite web
| author = Bray, T, Paoli, J, Sperberg-McQueen, CM, Maler, E and Yergeau, F (editors)
| title = Extensible Markup Language (XML) 1.0 (Fifth Edition)
| publisher = W3C
| date = 2008-11-26
| url = http://www.w3.org/TR/2008/REC-xml-20081126/
| accessdate = 2009-03-20}}
CSS:
- {{cite web
| author = Lie, H.W. and Bos, B.
| title = Cascading Style Sheets, level 1 (revised 2008-04-11)
| publisher = W3C
| date = 2008-04-11
| url = http://www.w3.org/TR/CSS1/
| accessdate = 2009-04-05}}
{{refend}}
External links