Section 4.2

Document metadata

6 entries from this section of the HTML Living Standard, in the order the standard presents them.

Read this section of the standard ↗

All 6 elements together

One small page that uses every element of this section. Turn on Show tags and point at any part of the page: a label tells you which element draws it. Click to jump to that element's details below.

Document metadata Written for this site

Every element of this section is in the page above. Point at one to find it, click it to read its details.

<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="Fresh bread every morning in the old town.">
    <title>Sunrise Bakery</title>
    <base href="https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/" target="_blank">
    <link rel="icon" href="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2064%2064'%3E%3Ccircle%20cx='32'%20cy='32'%20r='28'%20fill='%23f59e0b'/%3E%3Ccircle%20cx='32'%20cy='32'%20r='14'%20fill='%23fde68a'/%3E%3C/svg%3E">
    <style>
      body { margin: 0; font-family: system-ui, sans-serif; color: #3f2d1d; background: #fffbeb; }
      .hero { padding: 40px 28px 28px; background: linear-gradient(180deg, #fde68a, #fffbeb); }
      h1 { margin: 0; font-size: 2.2rem; }
      .hero p { margin: 6px 0 0; color: #92400e; }
      ul { margin: 0; padding: 20px 28px 32px; list-style: none; display: grid; gap: 10px; }
      li { background: #fff; border: 1px solid #fde68a; border-radius: 12px; padding: 12px 16px; line-height: 1.5; }
      code { color: #b45309; font-weight: 600; }
      a { color: #b45309; }
    </style>
  </head>
  <body>
    <div class="hero">
      <h1>Sunrise Bakery</h1>
      <p>This page looks simple, but its head is busy. None of it is drawn on the page:</p>
    </div>
    <ul>
      <li>The <code>&lt;title&gt;</code> is the name in the browser tab above.</li>
      <li>The <code>&lt;link&gt;</code> gives that tab its round yellow icon.</li>
      <li>The <code>&lt;style&gt;</code> paints these warm colors.</li>
      <li>The <code>&lt;meta&gt;</code> elements give information about the page: its character encoding, how it fits a phone screen, a short description.</li>
      <li>The <code>&lt;base&gt;</code> makes short links point to MDN and open in a new tab: try <a href="base">this link</a>.</li>
      <li>All of them sit inside <code>&lt;head&gt;</code>, which holds what visitors don't see.</li>
    </ul>
  </body>
</html>

Each element in detail

<title>

Baseline: widely availablesince January 2018

WHATWG Document title

MDN The <title> HTML element defines the document's title that is shown in a browser's title bar or a page's tab. It only contains text; HTML tags within the element, if any, are also treated as plain text.

Live preview Example from MDN
<title>Awesome interesting stuff</title>

Content model

Categories
metadata
Parents
head
Children
text*
Interface
HTMLTitleElement

Browser support

First browser version supporting <title>
Chrome 1
Edge 12
Firefox 1
Safari 1
Chrome Android 18
Safari iOS 1

First version with support, from MDN browser-compat-data.

Attributes

No element-specific attribute.

Also accepts the global attributes.

<base>

Baseline: widely availablesince January 2018

WHATWG Base URL and default target navigable for hyperlinks and forms

MDN The <base> HTML element specifies the base URL to use for all relative URLs in a document. There can be only one <base> element in a document.

Live preview Example from MDN
<base href="https://www.example.com/" />
<base target="_blank" />
<base target="_top" href="https://example.com/" />

Content model

Categories
metadata
Parents
head
Children
empty
Interface
HTMLBaseElement

Browser support

First browser version supporting <base>
Chrome 1
Edge 12
Firefox 1
Safari 3
Chrome Android 18
Safari iOS 2

First version with support, from MDN browser-compat-data.

Attributes

Also accepts the global attributes.

<meta>

Baseline: widely availablesince January 2018

WHATWG Text metadata

MDN The <meta> HTML element represents metadata that cannot be represented by other meta-related elements, such as <base>, <link>, <script>, <style>, or <title>.

Live preview Example from MDN
<meta
  name="description"
  content="The HTML reference describes all elements and attributes of HTML, including global attributes that apply to all elements." />

Content model

Categories
metadata; flow*; phrasing*
Parents
head; noscript*; phrasing*
Children
empty
Interface
HTMLMetaElement

Browser support

First browser version supporting <meta>
Chrome 1
Edge 12
Firefox 1
Safari 1
Chrome Android 18
Safari iOS 1

First version with support, from MDN browser-compat-data.

Attributes

name
Metadata name Value: Text*
content
Value of the element Value: Text*
media
Applicable media Value: Valid media query list

Also accepts the global attributes.

<style>

Baseline: widely availablesince January 2018

WHATWG Embedded styling information

MDN The <style> HTML element contains style information for a document, or part of a document. It contains CSS, which is applied to the contents of the document containing the <style> element.

Live preview Example from MDN
<style>
  p {
    color: #26b72b;
  }
  code {
    font-weight: bold;
  }
</style>

<p>
  This text will be green. Inline styles take precedence over CSS included
  externally.
</p>

<p style="color: blue">
  The <code>style</code> attribute can override it, though.
</p>

Content model

Categories
metadata; flow
Parents
head; noscript*; flow*
Children
text*
Interface
HTMLStyleElement

Browser support

First browser version supporting <style>
Chrome 1
Edge 12
Firefox 1
Safari 1
Chrome Android 18
Safari iOS 1

First version with support, from MDN browser-compat-data.

Attributes

media
Applicable media Value: Valid media query list

Also accepts the global attributes.