Definitions of HTML Terms

 

ATTENTION: THIS PAGE IS Valid HTML 5 AND IS BEST VIEWED WITH HTML 5 - Please upgrade your browser or download one of the HTML 5 compatible browsers such as Mozilla Firefox, Chrome, Opera or IE 9 (March 14, 2011 or later). For more information see HTML 5 browsers.


If you find this helpful, please click the Google +1 Button to the left, if it is white, to make it turn blue or red. Thank you! (It also helps find this page again more easily.)


PDF mobile

HTML Glossary - Definitions of HTML Terms

Start with these meanings to learn HTML vocabulary
anchor
attribute
block element
block tag
boolean attribute
camel case
child element
common attribute
content model
DOM
element
embedded content
empty element
enumerated attribute
flow content
generic attribute
global attribute
heading content
implied element
An implied element is an element node in the DOM that did not explicitly appear in the serialized form of the document and therefore was assumed based on other HTML code.
inline element
inline tag
inner HTML
letter case
local attribute
lower case
metadata content
mixed case
namespace
node
phrasing content
polyglot
property
root node
sectioning content
small caps
tag
text content
title case
top element
transparent content
upper case
void element

Definition of HTML "anchor"

An anchor in an HTML document is a named location (bookmark) that can be referenced by a URL, usually coded in an href attribute or src attribute of an HTML tag. The location is named by the id attribute of the HTML tag at the target location. When a user clicks on the link, most browsers will automatically scroll a web page to the location of the target anchor on the page.

Changes in HTML 5

In previous versions of HTML, an <a> tag with a name attribute but no href was used for anchors in HTML code. In HTML 5, the id attribute for the target location can be coded on most HTML tags.


Definition of HTML "attribute"

An attribute is a named property associated with an element. In a marked-up document, attributes are coded in a starting tag or standalone tag between the element name and the tag's terminating /> or > delimiter. The code for an HTML attribute consists of the attribute name, an equal sign (=) and the value of the property enclosed in quotes.


Definition of HTML "block tag" and "block element"

(also known as "block-level tags" and "block-level elements")
Definition of block tag

Block tags are the HTML tags that are used to create blocks of text and other visual elements in the direction of flow of paragraphs on a page, which is from top to bottom in many languages. For example, the <div> tag is normally a block tag, in contrast to the <span> tag, which is normally an inline tag. However, styles can be used to override a tag to make it a display: block tag.

Block tags in an HTML document mark the beginning and end of a block element.

Definition of block element

In the HTML content models, a block element consists of the starting and ending tags for flow content along with the phrasing content between them. Block elements are the HTML elements for blocks of text and other visual elements displayed in the direction of flow of paragraphs on a page, which is from top to bottom in many languages. For example, div element is normally a block element, in contrast to the span element, which is normally an inline element. However, styles can be used to override an element to make it a display: block element.

The beginning of each block element starts on a new line of the area of the page being filled. The margins before and after block elements can be used to control the spacing between paragraphs and other block elements.


Definition of HTML "boolean attribute"

A boolean attribute is a property associated with an element that represents either a true or false value. In a polyglot HTML document, a boolean attribute with a true value is coded with a value that matches the attribute name, as in attribute="attribute". To indicate a false value the attribute should be completely omitted.

Note that the HTML 5 specifications explicitly state that:

The values "true" and "false" are not allowed on boolean attributes.

This is because browsers that look at the coded value for boolean attributes would treat the string "false" as false while browsers that only look for the presence or absence of the attribute would treat that code as true, resulting in very inconsistent behavior.

Note that "true" and "false" are valid values for some non-boolean attributes, in particular enumerated attributes such as the draggable attribute.


Definition of HTML "child element"

A child element is an element that is in the content of a parent element. In the serialized form of an HTML document, the child elements are enclosed between the parent element's start tag and it's end tag.


Definition of HTML "common attribute"

Common attributes are attributes that can be coded on almost any HTML element. In HTML, they are global attributes, but when being processed as pure XML, their names will be allocated in the namespace partition for element local attributes. In the HTML 4 and xHTML DTDs these were also known as generic attributes.

The common HTML attributes include:

core attributes
class, id, style and title
internationalization attributes
lang and dir
event handling attributes
the on... event attributes for client-side dynamic script events
accesskey, contenteditable, contextmenu, data-*, draggable, dropzone, hidden, item..., spellcheck, tabindex

Definition of HTML "content model"

The content model of an element determines what type of content the element can contain between the element's starting and ending tags. Most HTML elements either require inner HTML consisting of specific child elements or of one of three more general categories of content:


Definition of HTML "DOM"

Definition of "Document Object Model"

The Document Object Model is a well-defined model for SGML and XML documents, which can be "marked up" with tags such as in HTML. While actual documents are often viewed by authors as text into which the markup tags have been inserted, the DOM focuses more on the tags themselves, which are represented in the model by elements, and their content.


Definition of HTML "element"

An element is an object in the hierarchical model of a document. It always has an element name and may also have attributes and/or child elements. The difference between an element and a tag is that an "element" is a more abstract representation of a node in the hierarchical structure of an HTML document that encompasses its attributes, child elements and other content such as text and CDATA sections. In an actual document, an element is explicitly represented by either a start tag and an end tag or closing tag enclosing its child elements and other content, if any, or simply by a standalone tag if it is a void element, which never has any content. In some cases, an element is implied even when the corresponding tag does not appear in the document. A good example of this is the tbody element, which is often an implied element between a <table> tag and a <tr> table row tag.

An element has a set of named property values, which may come from attributes or may be assumed based on default values or other elements or properties.

The term element is normally used when referring to the internal representation of an HTML object as a node in the document's hierarchical object model, encompassing all of its descendants. In contrast, the term tag typically refers to the mark up in the serialized form of an HTML document.

When referring to a node, along with any descendants, within the hierarchical object model of the internal representation of an HTML document the term element is normally used and, on this site in particular, the element name will be shown without any delimiters ("<", ">", "</" or "/>"). Those characters will only be used when discussing HTML tags, since they are used to delimit HTML code from other text in the serialized form of HTML documents.

Definition of HTML "element type"

The element type determines the meaning of a element, based on the element name, and what properties are valid for the element.


Definition of HTML "embedded content"

Embedded content is created by the elements of HTML that reference external resources, such as external media (images, audio or video) and show them as seamless parts of the document containing those elements. The tags for HTML elements that create embedded content include:


Definition of "empty element"

An empty element is an element with just a start tag and an end tag, but no content other than possibly some HTML comments or white space between the tags.

Contrast with a void element, which refers to the content model of an element and typically is coded with a self-closing start tag.

Both empty elements and void elements may have content models that are empty, indicating that they cannot contain any nested child elements or text nodes. All properties of an element with an empty content model must be coded as attributes.

Some browsers violate the rules for how to code void elements and empty elements. For example, Internet Explorer only processes <link> tags when coded with a separate start and end tag:

<link rel="shortcut icon" sizes="16x16" type="image/vnd.microsoft.icon" href="/favicon.ico"></link>

Definition of HTML "enumerated attribute"

An enumerated attribute is an HTML attribute whose value is restricted to a specific list of values, usually a fairly small number of keywords but sometimes non-alphabetic values such as digits or an empty string, which could be used as a synonym for the default value.


Definition of HTML "flow content"

In the content tree that makes up the body of an HTML document, flow content is the content at the higher level, such as paragraphs and lists, that is typically made up of HTML block elements. The phrasing content at the lower level of the content tree is contained within the block-level elements that make up the flow content.

When the expected content of an HTML element is flow content, you can code either flow content elements or phrasing content elements, with some occasional restrictions. On the other hand, flow content elements can only be used where flow content is allowed.

See Flow Content vs. Phrasing Content for more information.


Definition of "fragment identifier"

A fragment identifier is a string of characters that is frequently used to identify a specific location within an HTML page. In a URI, if the identifier contains any spaces or special characters, they must be escaped using percent escape codes as explained in the URL-encoding tutorial.

Fragment identifiers are defined by RFC 2396 and in general can be appended to a URI to be used after the resource has been retrieved. For HTML documents, the browser will retrieve the document specified by the URI then automatically scroll the browser window if necessary so the specified location on the page appears in the currently visible area. If the href attribute of a hyperlink consists of just a fragment identifier with no URI, the browser will scroll the current page to the specified location.


Definition of "global attribute"

A global attribute is an attribute with a name allocated in the global attribute name partition associated with a specific namespace URI and therefore is independent of any specific element type. When an attribute is defined as a global attribute it is not limited to a single element type; various elements in the same namespace or even other namespaces can be defined to allow the attribute to be coded on those elements.

The HTML common attributes are one example of global attributes. However, unlike XML global attributes, which must always be explicitly prefixed, the HTML common attributes do not have a namespace prefix but are defined to be automatically associated with the HTML namespace. The consequence of this is that they will be processed as global attributes when the document is being processed as HTML or xHTML, but as local attributes when the document is being processed as pure XML.

Contrast with local attribute and the HTML common attributes, which are global attributes in HTML documents.


Definition of HTML "heading content"

Heading content defines the headings of a section. The tags for HTML elements that create heading content are:


Definition of HTML "implied element"

An implied element is an element node in an HTML document's hierarchical object model that did not explicitly appear in the document's serialized code, and therefore was assumed based on other HTML code in the document. A good example of an implied element is the tbody element, which is often assumed between a <table> tag and the first <tr> table row tag underneath it.


Definition of HTML "inline tag" and "inline element"

Definition of inline tag

Inline tags are the HTML tags that are used to create text and other visual elements in the direction of flow of text within a paragraph, which is from left to right in many languages. For example, <span> tag is normally an inline tag, in contrast to the <div> tag, which is normally a block tag. However, styles can be used to override a tag to make it a display: inline tag.

Definition of inline element

In the HTML content models, an inline element consists of a single standalone inline tag or the starting and ending tags for phrasing content along with any other phrasing content between them. Inline elements are the HTML elements for text and other visual elements displayed in the direction of flow of text within a paragraph, which is from left to right in many languages. For example, the span element is normally an inline element, in contrast to the div element, which is normally a block element. However, styles can be used to override an element to make it a display: inline element.

In an HTML document, an inline element is created by either a single standalone self-closed tag or else a pair of starting and ending tags, which mark the beginning and end of the element. The element type indicated by the element name determines whether the element is an inline element or not.

Phrasing content consists of text that may be interspersed with inline elements.


Definition of "inner HTML"

Inner HTML is the HTML content between the > at the end of the starting tag of an element and the < at the beginning of the ending tag of the same element (but not a void element), not including the tags themselves. The inner HTML is usually either flow content or phrasing content, depending on the content model of the element.

For example, in the following HTML code:

<p>Humpty Dumpty sat on a wall.<br/>
   Humpty Dumpty had a great fall.</p>

"Humpty Dumpty sat on a wall." and "Humpty Dumpty had a great fall." with its leading whitespace are two groups of text content that, along with the <br/> tag is some phrasing content that makes up the inner HTML of the p element for the paragraph.


Definition of "lower case", "upper case", "mixed case", "title case", "small caps" and "camel case"

TermExampleDefinition
lower caseall lower caseall letters are written as small letters
upper caseALL UPPER CASEall letters are written as capital letters
mixed caseFor lunch I ate at McDonald's.the first letters of sentences and proper names are written as capital letters, with some other letters capitalized in special cases such as the article "I" and compound names
title casePanama City Beachthe first letter of each word is written as a capital letter, as frequently seen in titles and proper names
small capssmall capslower case letters are written in a font variant that makes them appear like capital letters
camel casebackgroundColorin a term written as a compound word without spaces, the first letter of each word except the first is capitalized in order to make it more readable; frequently used in programming languages and markup languages such as HTML

Definition of "local attribute"

A local attribute is firmly associated with a specific element type and therefore is defined to be coded only on that element. The name of a local attribute is allocated from an namespace partition for that specific element's attribute names and is only associated with a namespace indirectly through that element. A local attribute with the same name on another element is a distinctly different type of attribute.

Contrast with global attribute and the HTML common attributes, which are global attributes in HTML documents.


Definition of "Markup Language"

or "Tag Language"

A markup language is an artificial language used to add style information or other metadata to documents. The term markup originates from the way typewritten documents, such as news articles, were marked up with instructions for editing or typesetting.

Most markup languages for documents on the Internet consist of tags that are inserted into the text content of a document. A few of the markup languages for Internet documents are:

  • Atom Feed Format
  • HTML - Hypertext Markup Language
  • RSS - Really Simple Syndication feed format
  • SGML - Standard Generalized Markup Language
  • XHTML - Extensible HTML
  • XML - Extensible Markup Language

Definition of HTML "metadata content"

Metadata content is created by the elements of HTML that are normally not displayed directly to the user but instead provide additional information for browsers and other user agents parsing the HTML. The metadata can describe the relationship of other documents in relation to the one being parsed or affect the presentation or behavior of other content in the same document.

The tags for HTML elements that create metadata content include:


Definition of HTML "namespace"

A namespace is an attribute associated with the name of some object, such as a node in an HTML document, that distinguishes the type of object represented by the name from other types of objects with the same name in other namespaces. For example, in

<head><title>Heading Title</title></head>

title is the name of an element (the title element) in HTML while in

<a href="..." title="link title" ...>

title is the name of a title attribute on an HTML <a> tag.

On this site, the notation <a href> refers to the href attribute in the html:a element namespace, where html: is the namespace prefix for the HTML namespace.

See the HTML Namespace Tutorial for more information on namespaces in HTML 5.


Definition of HTML "node" in DOM

A node is the representation of an object in the hierarchical model of a document. Types of nodes in a DOM include:

element nodes
attribute nodes
non-markup content - text, character data and whitespace
These nodes provide a model for content between the ">" ending one tag in a marked-up document and the "<" beginning another tag, which includes whitespace, text, character references and character data sections.
declarations
such as the xml declaration and the DOCTYPE declaration
processing instructions
such as the xml-stylesheet processing instruction
comments

Definition of HTML "phrasing content"

In the content tree that makes up the body of an HTML document, phrasing content is the content at the lower level that consists of text and HTML elements that mark up the text within paragraphs. Generally, text content and other phrasing content marked up with inline tags is also categorized as phrasing content, but a block tag with phrasing content inside it is categorized as flow content.

The simplest form of phrasing content is plain text content. Text content and phrasing content elements can usually be used where either flow content or phrasing content is expected.

When the expected content of an HTML element is phrasing content, you cannot code any flow content elements, only phrasing content elements, with some occasional additional restrictions.

See Flow Content vs. Phrasing Content for more information.

HTML Phrase Elements

HTML phrase elements, as defined in HTML 4, are one type of inline element that can be used to mark up phrases and are some of the elements that can be used in phrasing content.


Definition of HTML "polyglot"

Polyglot HTML documents can be processed by either HTML or XML parsers

A polyglot HTML document is an HTML document that has been coded in such a way that it can be successfully parsed in any of three ways:

  1. as an HTML serialization of HTML, such as by web browsers and other software that process HTML documents from that serialization format
  2. as an XML serialization of HTML (xHTML), such as by web browsers and other software that process HTML documents from that serialization format
  3. as pure XML, such as by aggregators, XSLT and other software that process documents as XML

A significant advantage of starting to code HTML documents using polyglot HTML syntax is that, by definition it is a common generic subset of the other possible syntaxes, and so there are fewer rules for newcomers beginning to code HTML to learn. Then if at some point later you find a need for a feature of one of the more specific HTML syntax alternatives for some task you are trying to accomplish, you will be able to determine which of the two possible HTML syntax options should suit your needs.


Definition of HTML "property"

A property is a simple data structure consisting of a name and a value, also known as a name-value pair. An HTML property is a characteristic of something in an HTML document. In HTML, a property always has some value, possibly null or empty, that might come from its default value, an inherited value or a value explicitly set by an attribute on an HTML tag.

The HTMLPropertiesCollection interface provides access to a collection of properties.


Definition of HTML "root node"

The root node of the Document Object Model is a single node that is the parent of the nodes at the top of a document's nested tag hierarchy, the nodes at the beginning of the document, which includes a single top element. In an HTML document the root node is the parent of the element represented by the <html> tag and of any other top-level nodes such as processing instructions.


Definition of HTML "sectioning content" and "section outline"

Sectioning content defines the scope of heading elements and footer elements. The tags for HTML elements that create sectioning content are:

These tags explicitly create a section. When they are not coded, the following tags will implicitly create a section:

A section outline (not to be confused with the CSS outline property) is a tree representation of the sections starting with a sectioning root tag and including the sections explicitly or implicitly created within the scope of the outline. No more than one heading for each section is included in the outline.


Definition of HTML "tag"

A tag in HTML is a representation of an element in the serialized form of an HTML document. A start tag or empty tag contains a <, the element name, one or more optional attribute name/value pairs separated from the tag name and other attributes by whitespace and ends with either > or />, such as <br/>, which is the line break tag in HTML. An end tag contains just </, the tag name and >, for example </html> which is the </html> end tag.

The term tag is normally used when referring to the mark up in the serialized form of an HTML document. In contrast, the term element typically refers to the internal representation of an HTML object as a node in the document's hierarchical object model, encompassing all of its descendants.

A standalone tag is single tag that starts with the < delimiter and is self-closed with />. A standalone tag has no inner HTML content, not even HTML comments.

In an HTML document's serialized form, the name of a tag can be easily recognized because it will always be preceded by a left angle brace ("<"), if it's a start tag or a standalone tag, or the by the characters "</" if it's an end tag. On this site, an element name with these characters indicates that the serial representation of the element is being discussed. An element name without these delimiters indicates that the internal representation of the element in the internal object model is being discussed.


Definition of "text content"

Text content is the text between the > at the end of one tag and the < at the beginning of another tag, not including the tags themselves. By definition, text content does not contain any HTML tags, although it might contain HTML comments. The tags before and after the text content do not necessarily need to be matching starting and ending tags; one or both could be a standalone tag or they could be the ending tag of one element and the starting tag of another. Text content marked up with inline tags is categorized as phrasing content.

For example, in the following HTML code:

<p>Humpty Dumpty sat on a wall.<br/>
   Humpty Dumpty had a great fall.</p>

"Humpty Dumpty sat on a wall." and "Humpty Dumpty had a great fall." with its leading whitespace are both some text content. These two groups of text content along with the <br/> tag is phrasing content and the entire paragraph, including the starting and ending paragraph tags, is flow content.


Definition of HTML "top element"

The top element, sometimes called the document element or root element (not to be confused with the root node or sectioning root element), is a single element in the DOM that encloses all of the other text and markup tags in the document except for any comments outside the top element and a few leading declarations and processing instructions. One of these declarations, the DOCTYPE declaration, includes the document element name, which is html for HTML documents. The parent node of the top element and any other nodes outside of it is the root node. In an HTML document, the top element is created by the <html> start tag at the beginning of a document and the </html> end tag at the end of the document, which enclose all other HTML tags in the document.


Definition of HTML "transparent content"

There are a few HTML tags that are considered transparent in that when their content is considered to be phrasing content then the element itself is also considered to be phrasing content and when their content is considered to be flow content then the element itself is also considered to be flow content. The tags for HTML elements with transparent content include:


Definition of URI (Uniform Resource Identifier) and URI Reference

Definition of URI

A URI is a string of characters that can be used to identify an abstract or physical resource. URIs are defined by RFC 3986. In many cases, URIs are used to identify a point of content, such as an HTML web page or a specific location within a particular web page.

A URL is one type of URI that identifies a resource, such as a web page, by its location on the Internet. A # and fragment identifier can be appended to the URL to identify a specific point within the web page. Therefore, in HTML, values of a number of attributes are coded as URIs. When the scheme is http or https, the format of the URI is:

http://host.domain.tld/path/file-name.ext?query#fragment
https://host.domain.tld/path/file-name.ext?query#fragment

The initial URL part of these types of URIs identify resources that can be located and retrieved via the Internet. Note that the #fragment is not part of the URL. According to RFC 3986 (and one of its predecessors, RFC 2396), the fragment is handled on the client (browser) side after the resource has been located and retrieved via the URL part of the URI.

Definition of URI Reference

A URI reference is either a full URI or a relative URI that will be resolved relative to a base URI. For example, in an HTML document a URI reference without a full URL part can be resolved relative to the base URL of the document.


Definition of URL (Uniform Resource Locator)

A URL is a string of characters that identifies a resource, such as a web page, by its location on the Internet. The format of a URL that uses the HTTP protocol to retrieve a resource is:

http://host.domain.tld/path/file-name.ext?query

When the scheme at the beginning of the URL is https instead of http, the resource is retrieved over a secure (SSL) connection.

One difference between a URL and a URI with the HTTP protocol is that there is no #fragment in a URL. According to RFC 3986 (and one of its predecessors, RFC 2396), a URL is one type of URI that identifies a resource. By appending a fragment identifier to a URL, a URI can be used to identify a specific point of content within that resource.

Whether the resolved value of a URI reference should be a URL or a URI depends more on the type of resource being referenced than where it is coded. For example, two-dimensional images don't have placemarks to scroll to a particular place in the image, therefore the value of the <img src> attribute should resolve to a URL. In the future, however, the <audio src> and/or <video src> attributes might allow skipping to a placemark (time code) in a media resource.

Note that the HTML 5 specification defines the term URL different from the standard definition of URL, as indicated by the specification itself:

Note: The term "URL" in this specification is used in a manner distinct from the precise technical meaning it is given in RFC 3986. Readers familiar with that RFC will find it easier to read this specification if they pretend the term "URL" as used herein is really called something else altogether. This is a willful violation of RFC 3986.

Definition of HTML "void element"

A void element is an element that can never have any child elements or text content. The term refers to the content model of an element without any content. In ployglot HTML documents, a void element is usually coded as a self-closing empty tag (<br/>, <img .../>) rather than with a separate start tag and end tag (<br></br>, <img ...></img>).

Contrast with empty element, which refers to an element with no content in the serialized form of an HTML document.

Some browsers violate the rules for how to code void elements and empty elements. For example, Internet Explorer only processes <link> tags when coded with a separate start and end tag:

<link rel="shortcut icon" sizes="16x16" type="image/vnd.microsoft.icon" href="/favicon.ico"></link>

Valid HTML 5