A field guide · MMXXIV edition

Every HTML element, demonstrated.

From <a> to <wbr>, a living specimen collection of the HTML living standard — each tag dissected with a live demo, a short note, and the JavaScript that animates it.

elements catalogued
15chapters
Begin reading

01 Document Head

The invisible machinery that makes a page a page.

<head>metadata

Container for document metadata. Everything here is invisible in the body but shapes how the page is parsed, linked, and shared.

This page's <head> includes <meta charset>, <meta name="viewport">, <meta name="description">, <base href>, <title>, three <link> relations, a <style> block, and a deferred <script src>. View source to inspect.

<title>metadata

The document's title. Shown in the browser tab, used for bookmarks, and fed to search engines.

<meta>metadata

Key/value pairs describing the document: charset, viewport, description, Open Graph, theme-color.

Look for <meta name="description">, <meta property="og:title">, and <meta name="theme-color"> in this document's head.

<link>metadata

Relations to external resources: stylesheets, icons, preconnects, manifests.

Used here for style.css, Google Fonts (preconnect + stylesheet), an SVG favicon as a data URI, and a manifest.

<base>metadata

Sets the default URL and target for all relative links and forms on the page.

This page sets <base href="./">.

<style>metadata

Inline CSS. This page uses one for critical pre-paint variables and a no-flash theme fallback.

html[data-theme="light"]{
  --bg:#f5f0e8; --fg:#1a1612;
  --accent:#c2410c; --accent-2:#0d7d6a;
}

02 Sections & Structure

The load-bearing walls of the document.

<header>
<nav>
<aside>
<main>
<section> · <article>
<header>sectioning

Introductory content or navigational aids for its nearest section.

<nav>sectioning

A major navigation block. The sidebar <nav> lists all chapters.

<main>sectioning

The dominant content of the document. There can be only one.

<section>sectioning

A thematic grouping with a heading. Each chapter on this page is a <section>.

<article>sectioning

A self-contained composition — reusable in syndication. Each specimen card is an article.

<aside>sectioning

Tangentially related content. This sidebar is an <aside>.

<footer>sectioning

Closing content: copyright, links, author info. See the bottom of this page.

<hgroup>heading

Groups a heading with secondary content (subtitles, taglines).

<h1>–<h6>heading

Six levels of section headings.

H1 — chapter

H2 — section

H3 — sub

H4 — minor

H5 — note
H6 — fine print
<address>sectioning

Contact information for the document or an article.

The HTML Codex
127.0.0.1, Suite <body>
curator@codex.dev
<search>sectioning

A search filter region. New in the living standard. (See the top bar for a live example).

03 Text Content

Block-level vessels for prose, code, and quoted matter.

<p>text

A paragraph. The atomic unit of prose.

This is a paragraph. Inline elements live inside it.

<blockquote>text

A block-level quotation.

The HTML standard is not a fixed document — it is a living one, revised in the open.

WHATWG
<hr>text

A thematic break between paragraph-level elements.

Before


After

<pre>text

Preformatted text — whitespace is preserved.

function hello() {
  return "world";
}
<figure> / <figcaption>text

Content with an optional caption — diagrams, photos, code listings.

"The web is the most platform-independent platform ever invented."
As quoted in Patterns of Software.
<div>text

A generic container with no semantic meaning. Use only when nothing else fits.

A bare <div>, styled.

04 Inline Semantics

The flavour of words.

You can link to places, abbreviate terms, bring importance, emphasis, and bold/italic for purely visual reasons. Code looks like <element>, while keyboard input uses Ctrl+S. Sample output appears as saved ✓, and variables as x = 42.

You can highlight text, mark something as struck through or deleted / inserted, drop to fine print, raise superscripts and lower subscripts. Quotations become inline like this. A line break
forces a new line, while thisverylongwordcanbreakifnecessary.

The Iliad is attributed to Homer. A definition term is used to define new words. The current time is . Bidirectional text uses سلام and overrides like deliberately reversed. Ruby annotations place kanji above characters. π carries a machine value.

<span>inline

A generic inline phrasing container.

A coloured span mid-sentence.

<u>inline

Unarticulated annotation — typically rendered underlined.

underlined
<rp>inline

Fallback parenthesis shown when ruby annotations are unsupported.

JSON(JavaScript Object Notation)

05 Links

The thing that makes it a web.

06 Lists

Ordered, unordered, described, and menued.

<ul>list
  • Unordered
  • Bulleted
  • List
<ol>list
  1. Ordered
  2. Numbered
  3. List
<dl>list

A description list — pairs of terms and descriptions.

HTML
HyperText Markup Language
CSS
Cascading Style Sheets
<menu>list

A list of commands — semantic sibling of <ul> for interactive items.

  • 07 Media

    Pictures, sounds, and moving images.

    <img>media

    An image. Always include alt.

    A random photograph
    <picture> / <source>media

    Multiple sources for responsive/art-directed images.

    Art-directed image
    <figure> + <map> + <area>media

    An image map — clickable regions on a single image.

    Image map demo Left half Right half
    Click left → chapter 1, right → chapter 14.
    <audio>media

    An audio player. Synthesised here with the Web Audio API — no file needed.

    <video> / <track>media

    A video player with optional captions via <track>.

    08 Embedded

    Foreign documents inside the document.

    <iframe>embedded

    Nested browsing context.

    <embed>embedded

    A generic external content embed.

    <object> / <param>embedded

    Fallback-friendly external resource with parameters.

    Fallback content shown when object fails.
    <portal>embedded

    Experimental — preview another page that can be seamlessly navigated into.

    Not rendered here due to limited browser support; included for completeness.

    09 Vector & Canvas

    Drawing inside the document.

    <svg>vector

    Inline scalable vector graphics — shapes, paths, gradients, all in XML.

    SVG <text>
    <canvas>scripting

    A bitmap canvas drawn into via JavaScript. Click to add particles.

    Click anywhere on the canvas.

    <math>math

    MathML — for mathematical notation.

    e=n=0 1n!

    10 Tables

    Two-dimensional data, semantically.

    <table> and friendstabular

    Structured tabular data: <caption>, <colgroup>/<col>, <thead>, <tbody>, <tfoot>, <tr>, <th>, <td>.

    Browser share by category (illustrative)
    EngineBrowserYearStatus
    GeckoFirefox2004Active
    WebKitSafari2003Active
    BlinkChrome2008Active
    Total active engines3

    11 Forms

    Every input type, every control.

    Identity
    Numerics & dates
    Choices
    radio — pick a tier
    value: "secret-token"
    Long-form & feedback
    45%
    Live sum will appear here
    Buttons & image input

    Form is idle. Try changing values.

    12 Interactive

    Native disclosure & modals.

    <details> / <summary>interactive

    A disclosure widget — no JavaScript required.

    What is the HTML living standard?

    A continuously updated specification maintained by WHATWG, with no versioned releases — only a single, evolving document.

    Why is it "living"?

    So browsers can ship features as they mature, rather than waiting years for a numbered release.

    <dialog>interactive

    A modal or non-modal dialog. Use the showModal() method.

    Greetings

    This is a native <dialog>. No libraries, no portal — just the platform.

    13 Edits

    Tracking additions and removals.

    <ins> / <del>edits

    Inserted and deleted text, optionally with timestamps.

    The meeting is scheduled for Tuesday at 10 Wednesday at 2pm.

    14 Scripting

    Where the document meets the program.

    <script>scripting

    Embeds or references executable code. This page loads script.js via <script src defer>.

    Open the console — you'll see a styled greeting from script.js.

    <noscript>scripting

    Fallback content when scripting is disabled.

    <template> / <slot>component

    Inert markup used to clone content later, or to declare slots in a shadow DOM.

    15 The CSS Lab

    Select an element, write CSS properties, see it live instantly.