designwithfocus

HTML

HTML Element Types: Categories in the Living Standard

By Design With Focus Team 6 min read
Seven HTML content categories labeled on a simple document outline

Short answer

HTML element types in the Living Standard are content categories: metadata, flow, sectioning, heading, phrasing, embedded, and interactive, and the same section also defines palpable content and script-supporting elements. An element can sit in more than one. Sectioning, heading, phrasing, embedded, and interactive content are kinds of flow content. Metadata is sometimes flow content too. The categories describe what an element is for, not a separate browser mode.

Last verified against the sources listed below.

Key takeaways

  • The broad categories are metadata, flow, sectioning, heading, phrasing, embedded, and interactive.
  • The same section also defines palpable content and script-supporting elements.
  • An element can belong to zero or more categories.
  • Embedded content is also phrasing content. Interactive content sometimes is.
  • link and meta are metadata. span is phrasing. h1 through h6 are heading content.

HTML element types, in the Living Standard, are content categories that group elements with similar roles. They are not a menu of browser engines.

The kinds of content section lists seven broad categories: metadata, flow, sectioning, heading, phrasing, embedded, and interactive. The same section then defines palpable content and script-supporting elements. An element falls into zero or more of these.

Some elements fit none of the broad groups and have their own rules.

What are the seven broad categories?

They are the groups the specification uses to say what an element is for and where it may appear.

Metadata content sets up the presentation or behavior of the rest of the content, the document’s relationship to other documents, or other out-of-band information. The list is base, link, meta, noscript, script, style, template, and title.

Flow content is most elements used in the body. Sectioning content defines the scope of header and footer: article, aside, nav, and section. Heading content defines the heading of a section: h1 through h6, and hgroup when it has an h1 to h6 descendant.

Phrasing content is the text of the document and the elements that mark it up inside a paragraph. Embedded content imports another resource, or inserts content from another vocabulary such as SVG or MathML. Interactive content is specifically intended for user interaction.

Category What the standard says Examples it lists
Metadata Sets up the document, or out-of-band information link, meta, style, title
Flow Most elements used in the body p, div, ul, headings
Sectioning Defines the scope of header and footer article, aside, nav, section
Heading Defines the heading of a section h1 through h6, qualifying hgroup
Phrasing Text and intra-paragraph markup span, em, a, text
Embedded Imports a resource or another vocabulary img, video, iframe, svg
Interactive Specifically for user interaction button, a with href, select

The standard’s lists are longer than the examples column. input is interactive when its type is not Hidden. audio and video are interactive when controls is present.

img is interactive when usemap or controls is present.

How do the categories nest?

Sectioning, heading, phrasing, embedded, and interactive content are all types of flow content. Metadata is sometimes flow content. Embedded content is also phrasing content, and it is sometimes interactive.

The standard says metadata and interactive content are sometimes phrasing content. A meta element is normally metadata. It is flow and phrasing when the itemprop attribute is present.

A link is metadata, and it is flow and phrasing when it is allowed in the body.

Most phrasing elements may contain only phrasing content, not arbitrary flow content. Text itself counts as phrasing content. Runs of phrasing content form paragraphs.

That is why a span belongs inside a sentence and a div is the block you reach for when the contents are flow.

What HTML is used for is the markup these categories organize.

A span is in the phrasing list. It marks text. It does not start a section.

What are palpable and script-supporting?

Palpable content is the standard’s way of saying an element is non-empty for people. Script-supporting elements exist to support scripts and are not rendered as their own content.

Palpable content provides descendant text that is not only whitespace, or something a person can hear (audio), view (video, img, or canvas), or interact with, such as a form control. Elements whose model allows any flow or phrasing content should generally contain at least one palpable node that is not hidden. The standard says this is not a hard requirement.

A placeholder that script will fill, or a template that is empty on some pages, can be legitimately empty.

Script-supporting elements do not represent anything themselves. The standard’s list is script and template. script is also metadata and can be flow and phrasing.

The script-supporting label explains why it is not a visible box. The parser still reads it. The parsing model builds a document from tokens, and a script token is part of that work.

The DOM standard is the tree those elements become: parents, children, and events. A category is an HTML rule about the element. A node is the object in the tree after parsing.

How is a category different from CSS display?

A content category says what the element means and what it may contain. display says what kind of box it generates.

MDN’s display property sets the outer box and the layout of the children, including flow, flex, and grid. A div is flow content whether or not you set display: flex. The flexbox spec says an element with computed display flex or inline-flex generates a flex container, and its in-flow children are flex items.

Those children keep their HTML categories. The flex item is a CSS box, not an eighth content category.

Changing display does not move link out of metadata or button out of interactive content. It changes layout. Put the category in the HTML, and put the box model in the CSS.

The link element is metadata content. The icon file is a resource that element can point at. The file is not itself an HTML element type.

The standard’s metadata list includes link next to meta, style, and title. Metadata is how the document points at other documents and resources. A favicon is one of those resources.

A favicon generator makes the file in the browser. You still place a link in the HTML so the parser records the relationship.

link can also be flow and phrasing when it is allowed in the body. A favicon reference belongs with the other metadata, in the head, because it sets up the document rather than appearing as phrasing text. Interactive content is a different list: a link is not on the interactive list the way an a with href is.

If a checker complains that a container is empty, look for palpable content, not for a new element type. If a script or a template seems to vanish, it is script-supporting and is not rendered as its own box. The categories already explain both cases.

Frequently asked questions

Can one element be in more than one category?

Yes. The standard says each element falls into zero or more categories. An a element with an href is interactive. A link element is metadata, and it can also be flow and phrasing when it is allowed in the body. An img is embedded content, which is also phrasing content, and it is interactive when usemap or controls is present. The categories are a set, not a single badge.

What is the difference between flow and phrasing?

Flow content is most of what you put in the body of a document or application. Phrasing content is the text of the document and the elements that mark up that text inside a paragraph. Runs of phrasing content form paragraphs. Most phrasing elements can contain only phrasing content, not general flow content. A div is flow. A span is phrasing. A paragraph expects phrasing, which is why a div inside a paragraph is the wrong shape.

Are palpable content and script-supporting elements extra types?

They are categories in the same kinds-of-content section, after the seven broad ones. Palpable content is what makes an element non-empty: descendant text, or something a person can hear, view, or interact with. The standard says the non-empty guidance is not a hard requirement, because a placeholder can be filled later by script. Script-supporting elements do not represent anything themselves. The standard lists script and template.

Is a heading just a larger font?

No. Heading content defines the heading of a section, whether the section is marked with sectioning content or implied by the heading. The elements are h1 through h6, and an hgroup if it has one of those as a descendant. Sectioning content is article, aside, nav, and section, and it defines the scope of header and footer. CSS can scale the type. The category is about the section, not the pixel size.

Where does a favicon link fit?

A link element is metadata content. Metadata sets up presentation or behavior, the relationship of the document to other documents, or other out-of-band information. The standard's metadata list is base, link, meta, noscript, script, style, template, and title. A favicon file is not one of those elements. The link in the head is the element that points at the file. The file itself is a separate resource.

Sources