<link>: The External Resource Link element - HTML: HyperText Markup Language

<link>: The External Resource Link element
==========================================

 The **`<link>`** HTML element specifies relationships between the current document and an external resource.
 This element is most commonly used to link to stylesheets, but is also used to establish site icons (both "favicon" style icons and icons for the home screen and apps on mobile devices) among other things.

Try it
------

To link an external stylesheet, you'd include a `<link>` element inside your `<head>` like this:

```html
<link href="main.css" rel="stylesheet" />
```

This simple example provides the path to the stylesheet inside an `href` attribute, and a `rel` attribute with a value of `stylesheet`. The `rel` stands for "relationship", and is one of the key features of the `<link>` element — the value denotes how the item being linked to is related to the containing document.

There are a number of other common types you'll come across. For example, a link to the site's favicon:

```html
<link rel="icon" href="favicon.ico" />
```

There are a number of other icon `rel` values, mainly used to indicate special icon types for use on various mobile platforms, e.g.:

```html
<link
 rel="apple-touch-icon"
 sizes="114x114"
 href="apple-icon-114.png"
 type="image/png" />
```

 The `sizes` attribute indicates the icon size, while the `type` contains the MIME type of the resource being linked.
 These provide useful hints to allow the browser to choose the most appropriate icon available.

You can also provide a media type or query inside a `media` attribute; this resource will then only be loaded if the media condition is true. For example:

```html
<link href="print.css" rel="stylesheet" media="print" />
<link
 href="mobile.css"
 rel="stylesheet"
 media="screen and (max-width: 600px)" />
```

Some interesting new performance and security features have been added to the `<link>` element too. Take this example:

```html
<link
 rel="preload"
 href="myFont.woff2"
 as="font"
 type="font/woff2"
 crossorigin="anonymous" />
```

 A `rel` value of `preload` indicates that the browser should preload this resource (see `rel="preload"` for more details), with the `as` attribute indicating the specific class of content being fetched.
 The `crossorigin` attribute indicates whether the resource should be fetched with a CORS request.

Other usage notes:

* A `<link>` element can occur either in the `<head>` or `<body>` element, depending on whether it has a link type that is **body-ok**.
 For example, the `stylesheet` link type is body-ok, and therefore `<link rel="stylesheet">` is permitted in the body.
 However, this isn't a good practice to follow; it makes more sense to separate your `<link>` elements from your body content, putting them in the `<head>`.
* When using `<link>` to establish a favicon for a site, and your site uses a Content Security Policy (CSP) to enhance its security, the policy applies to the favicon.
 If you encounter problems with the favicon not loading, verify that the `Content-Security-Policy` header's `img-src` directive is not preventing access to it.
* The HTML and XHTML specifications define event handlers for the `<link>` element, but it is unclear how they would be used.
* Under XHTML 1.0, void elements such as `<link>` require a trailing slash: `<link />`.
* WebTV supports the use of the value `next` for `rel` to preload the next page in a document series.
Attributes
----------

This element includes the global attributes.

`as`

 This attribute is required when `rel="preload"` has been set on the `<link>` element, optional when `rel="modulepreload"` has been set, and otherwise should not be used.
 It specifies the type of content being loaded by the `<link>`, which is necessary for request matching, application of correct content security policy, and setting of correct `Accept` request header.

 Furthermore, `rel="preload"` uses this as a signal for request prioritization.
 The table below lists the valid values for this attribute and the elements or resources they apply to.

| Value | Applies To |
| --- | --- |
| audio | `<audio>` elements |
| document | `<iframe>` and `<frame>` elements |
| embed | `<embed>` elements |
| fetch | fetch, XHR

**Note:** This value also requires
 `<link>` to contain the crossorigin attribute, see CORS-enabled fetches.

 |
| font | CSS @font-face

**Note:** This value also requires
 `<link>` to contain the crossorigin attribute, see CORS-enabled fetches.

 |
| image | `<img>` and `<picture>` elements with
 srcset or imageset attributes, SVG `<image>` elements,
 CSS `*-image` rules
  |
| object | `<object>` elements |
| script | `<script>` elements, Worker `importScripts` |
| style | `<link rel=stylesheet>` elements, CSS
 `@import` |
| track | `<track>` elements |
| video | `<video>` elements |
| worker | Worker, SharedWorker |

`blocking`
Experimental

This attribute explicitly indicates that certain operations should be blocked on the fetching of an external resource. The operations that are to be blocked must be a space-separated list of blocking attributes listed below.

* `render`: The rendering of content on the screen is blocked.

`crossorigin`

 This enumerated attribute indicates whether CORS must be used when fetching the resource.
 CORS-enabled images can be reused in the `<canvas>` element without being *tainted*.
 The allowed values are:

`anonymous`

 A cross-origin request (i.e. with an `Origin` HTTP header) is performed, but no credential is sent (i.e. no cookie, X.509 certificate, or HTTP Basic authentication).
 If the server does not give credentials to the origin site (by not setting the `Access-Control-Allow-Origin` HTTP header) the resource will be tainted and its usage restricted.

`use-credentials`

 A cross-origin request (i.e. with an `Origin` HTTP header) is performed along with a credential sent (i.e. a cookie, certificate, and/or HTTP Basic authentication is performed).
 If the server does not give credentials to the origin site (through `Access-Control-Allow-Credentials` HTTP header), the resource will be *tainted* and its usage restricted.

 If the attribute is not present, the resource is fetched without a CORS request (i.e. without sending the `Origin` HTTP header), preventing its non-tainted usage. If invalid, it is handled as if the enumerated keyword **anonymous** was used.
 See CORS settings attributes for additional information.

`disabled`
Non-standard

 For `rel="stylesheet"` only, the `disabled` Boolean attribute indicates whether the described stylesheet should be loaded and applied to the document.
 If `disabled` is specified in the HTML when it is loaded, the stylesheet will not be loaded during page load.
 Instead, the stylesheet will be loaded on-demand, if and when the `disabled` attribute is changed to `false` or removed.

Setting the `disabled` property in the DOM causes the stylesheet to be removed from the document's `Document.styleSheets` list.

`fetchpriority`

Provides a hint of the relative priority to use when fetching a preloaded resource. Allowed values:

`high`

Signals a high-priority fetch relative to other resources of the same type.

`low`

Signals a low-priority fetch relative to other resources of the same type.

`auto`

Default: Signals automatic determination of fetch priority relative to other resources of the same type.

`href`

This attribute specifies the URL of the linked resource. A URL can be absolute or relative.

`hreflang`

 This attribute indicates the language of the linked resource.
 It is purely advisory.
 Allowed values are specified by RFC 5646: Tags for Identifying Languages (also known as BCP 47).
 Use this attribute only if the `href` attribute is present.

`imagesizes`

For `rel="preload"` and `as="image"` only, the `imagesizes` attribute is a sizes attribute that indicates to preload the appropriate resource used by an `img` element with corresponding values for its `srcset` and `sizes` attributes.

`imagesrcset`

For `rel="preload"` and `as="image"` only, the `imagesrcset` attribute is a sourceset attribute that indicates to preload the appropriate resource used by an `img` element with corresponding values for its `srcset` and `sizes` attributes.

`integrity`

 Contains inline metadata — a base64-encoded cryptographic hash of the resource (file) you're telling the browser to fetch.
 The browser can use this to verify that the fetched resource has been delivered free of unexpected manipulation.
 See Subresource Integrity.

`media`

 This attribute specifies the media that the linked resource applies to. Its value must be a media type / media query.
 This attribute is mainly useful when linking to external stylesheets — it allows the user agent to pick the best adapted one for the device it runs on.

`referrerpolicy`

A string indicating which referrer to use when fetching the resource:

* `no-referrer` means that the `Referer` header will not be sent.
* `no-referrer-when-downgrade` means that no `Referer` header will be sent when navigating to an origin without TLS (HTTPS).
 This is a user agent's default behavior, if no policy is otherwise specified.
* `origin` means that the referrer will be the origin of the page, which is roughly the scheme, the host, and the port.
* `origin-when-cross-origin` means that navigating to other origins will be limited to the scheme, the host, and the port, while navigating on the same origin will include the referrer's path.
* `unsafe-url` means that the referrer will include the origin and the path (but not the fragment, password, or username).
 This case is unsafe because it can leak origins and paths from TLS-protected resources to insecure origins.

`rel`

This attribute names a relationship of the linked document to the current document. The attribute must be a space-separated list of link type values.

`sizes`

 This attribute defines the sizes of the icons for visual media contained in the resource.
 It must be present only if the `rel` contains a value of `icon` or a non-standard type such as Apple's `apple-touch-icon`.
 It may have the following values:

* `any`, meaning that the icon can be scaled to any size as it is in a vector format, like `image/svg+xml`.
* a white-space separated list of sizes, each in the format `<width in pixels>x<height in pixels>` or `<width in pixels>X<height in pixels>`. Each of these sizes must be contained in the resource.

**Note:** Most icon formats are only able to store one single icon; therefore, most of the time, the `sizes` attribute contains only one entry.
 MS's ICO format does, as well as Apple's ICNS. ICO is more ubiquitous, so you should use this format if cross-browser support is a concern (especially for old IE versions).

`title`

 The `title` attribute has special semantics on the `<link>` element.
 When used on a `<link rel="stylesheet">` it defines a default or an alternate stylesheet.

`type`

 This attribute is used to define the type of the content linked to.
 The value of the attribute should be a MIME type such as **text/html**, **text/css**, and so on.
 The common use of this attribute is to define the type of stylesheet being referenced (such as **text/css**), but given that CSS is the only stylesheet language used on the web, not only is it possible to omit the `type` attribute, but is actually now recommended practice.
 It is also used on `rel="preload"` link types, to make sure the browser only downloads file types that it supports.

### Non-standard attributes

`methods`
Non-standard

Deprecated

 The value of this attribute provides information about the functions that might be performed on an object.
 The values generally are given by the HTTP protocol when it is used, but it might (for similar reasons as for the **title** attribute) be useful to include advisory information in advance in the link.
 For example, the browser might choose a different rendering of a link as a function of the methods specified;
 something that is searchable might get a different icon, or an outside link might render with an indication of leaving the current site.
 This attribute is not well understood nor supported, even by the defining browser, Internet Explorer 4.

`target`
Deprecated

Defines the frame or window name that has the defined linking relationship or that will show the rendering of any linked resource.

### Obsolete attributes

`charset`
Deprecated

 This attribute defines the character encoding of the linked resource.
 The value is a space- and/or comma-delimited list of character sets as defined in RFC 2045.
 The default value is `iso-8859-1`.

**Note:** To produce the same effect as this obsolete attribute, use the `Content-Type` HTTP header on the linked resource.

`rev`
Deprecated

 The value of this attribute shows the relationship of the current document to the linked document, as defined by the `href` attribute.
 The attribute thus defines the reverse relationship compared to the value of the `rel` attribute.
 Link type values for the attribute are similar to the possible values for `rel`.

**Note:** Instead of `rev`, you should use the `rel` attribute with the opposite link type value.
 For example, to establish the reverse link for `made`, specify `author`. Also, this attribute doesn't stand for "revision" and must not be used with a version number, even though many sites misuse it in this way.

Examples
--------

### Including a stylesheet

To include a stylesheet in a page, use the following syntax:

```html
<link href="style.css" rel="stylesheet" />
```

### Providing alternative stylesheets

You can also specify alternative style sheets.

 The user can choose which style sheet to use by choosing it from the **View > Page Style** menu.
 This provides a way for users to see multiple versions of a page.

```html
<link href="default.css" rel="stylesheet" title="Default Style" />
<link href="fancy.css" rel="alternate stylesheet" title="Fancy" />
<link href="basic.css" rel="alternate stylesheet" title="Basic" />
```

### Providing icons for different usage contexts

You can include links to several icons on the same page, and the browser will choose which one works best for its particular context using the `rel` and `sizes` values as hints.

```html
<!-- third-generation iPad with high-resolution Retina display: -->
<link rel="apple-touch-icon" sizes="144x144" href="favicon144.png" />
<!-- iPhone with high-resolution Retina display: -->
<link rel="apple-touch-icon" sizes="114x114" href="favicon114.png" />
<!-- first- and second-generation iPad: -->
<link rel="apple-touch-icon" sizes="72x72" href="favicon72.png" />
<!-- non-Retina iPhone, iPod Touch, and Android 2.1+ devices: -->
<link rel="apple-touch-icon" href="favicon57.png" />
<!-- basic favicon -->
<link rel="icon" href="favicon32.png" />
```

### Conditionally loading resources with media queries

 You can provide a media type or query inside a `media` attribute;
 this resource will then only be loaded if the media condition is true. For example:

```html
<link href="print.css" rel="stylesheet" media="print" />
<link href="mobile.css" rel="stylesheet" media="all" />
<link
 href="desktop.css"
 rel="stylesheet"
 media="screen and (min-width: 600px)" />
<link
 href="highres.css"
 rel="stylesheet"
 media="screen and (min-resolution: 300dpi)" />
```

### Stylesheet load events

You can determine when a style sheet has been loaded by watching for a `load` event to fire on it; similarly, you can detect if an error has occurred while processing a style sheet by watching for an `error` event:

```html
<script>
 const stylesheet = document.querySelector("#my-stylesheet");

 stylesheet.onload = () => {
 // Do something interesting; the sheet has been loaded
 };

 stylesheet.onerror = () => {
 console.log("An error occurred loading the stylesheet!");
 };
</script>

<link rel="stylesheet" href="mystylesheet.css" id="my-stylesheet" />
```

**Note:** The `load` event fires once the stylesheet and all of its imported content has been loaded and parsed, and immediately before the styles start being applied to the content.

### Preload examples

You can find a number of `<link rel="preload">` examples in Preloading content with `rel="preload"`.

### Blocking rendering till a resource is fetched

 You can include `render` token inside a `blocking` attribute;
 the rendering of the page will be blocked till the resource is fetched. For example:

```html
<link
 blocking="render"
 rel="preload"
 href="critical-font.woff2"
 as="font"
 crossorigin />
```

Technical summary
-----------------

|  |  |
| --- | --- |
| Content categories |
 Metadata content.
 If `itemprop` is present:
 Flow content and
 phrasing content.
  |
| Permitted content | None; it is a void element. |
| Tag omission | As it is a void element, the start tag must be present and the end tag must not be present |
| Permitted parents |
 Any element that accepts metadata elements.
 If itemprop is present: any element that accepts
 phrasing content.
  |
| Implicit ARIA role | `link` with `href` attribute |
| Permitted ARIA roles | No `role` permitted |
| DOM interface | `HTMLLinkElement` |

Specifications
--------------

| Specification |
| --- |
| HTML Standard # the-link-element |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `Link` HTTP header
* The `integrity` attribute on 150daysofhtml.com (2021)


<noembed>: The Embed Fallback element - HTML: HyperText Markup Language

<noembed>: The Embed Fallback element
=====================================

**Deprecated:** This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

The **`<noembed>`** HTML element is an obsolete, non-standard way to provide alternative, or "fallback", content for browsers that do not support the `<embed>` element or do not support the type of embedded content an author wishes to use. This element was deprecated in HTML 4.01 and above in favor of placing fallback content between the opening and closing tags of an `<object>` element.

**Note:** While this element currently still works in many browsers, it is obsolete and should not be used. Use `<object>` instead, with fallback content between the opening and closing tags of the element.

Examples
--------

The message inside `<noembed>` tag will appear only when your browser does not support `<embed>` tag.

### Show an alternative content

```html
<embed type="vide/webm" src="/media/examples/flower.mp4" width="200" height="200">
  <noembed>
    <h1>Alternative content</h1>
  </noembed>
</embed>
```

Specifications
--------------

| Specification |
| --- |
| HTML Standard # noembed |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.


<frame> - HTML: HyperText Markup Language

<frame>
=======

**Deprecated:** This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

The **`<frame>`** HTML element defines a particular area in which another HTML document can be displayed. A frame should be used within a `<frameset>`.

Using the `<frame>` element is not encouraged because of certain disadvantages such as performance problems and lack of accessibility for users with screen readers. Instead of the `<frame>` element, `<iframe>` may be preferred.

Attributes
----------

Like all other HTML elements, this element supports the global attributes.

`src`
Deprecated

This attribute specifies the document that will be displayed by the frame.

`name`
Deprecated

This attribute is used for labeling frames. Without labeling, every link will open in the frame that it's in – the closest parent frame. See the `target` attribute for more information.

`noresize`
Deprecated

This attribute prevents resizing of frames by users.

`scrolling`
Deprecated

This attribute defines the existence of a scrollbar. If this attribute is not used, the browser adds a scrollbar when necessary. There are two choices: "yes" for forcing a scrollbar even when it is not necessary and "no" for forcing no scrollbar even when it *is* necessary.

`marginheight`
Deprecated

This attribute defines the height of the margin between frames.

`marginwidth`
Deprecated

This attribute defines the width of the margin between frames.

`frameborder`
Deprecated

This attribute allows you to specify a frame's border.

Example
-------

### A frameset document

A frameset document has a `<frameset>` element instead of a `<body>` element. The `<frame>` elements are placed within the `<frameset>`.

```html
<!doctype html>
<html lang="en-US">
  <head>
    <!-- Document metadata goes here -->
  </head>
  <frameset cols="400, 500">
    <frame src="https://developer.mozilla.org/en/HTML/Element/iframe" />
    <frame src="https://developer.mozilla.org/en/HTML/Element/frame" />
  </frameset>
</html>
```

If you want to embed another HTML page into the `<body>` of a document, use an `<iframe>` element.

Specifications
--------------

| Specification |
| --- |
| HTML Standard # frame |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `<frameset>`
* `<iframe>`


<meta>: The metadata element - HTML: HyperText Markup Language

<meta>: The metadata element
============================

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

|  |  |
| --- | --- |
| Content categories | Metadata content. If the `itemprop` attribute is present:
 flow content,
 phrasing content.
  |
| Permitted content | None; it is a void element. |
| Tag omission |
 As it is a void element, the start tag must be present and the end tag
 must not be present.
  |
| Permitted parents | * `<meta charset>`,
 `<meta http-equiv>`: a
 `<head>` element. If the
 `http-equiv` is not an
 encoding declaration, it can also be inside a
 `<noscript>` element, itself inside a
 `<head>` element.
* `<meta name>`: any element that accepts
 metadata content.
* `<meta itemprop>`: any element that accepts
 metadata content
 or
 flow content.
 |
| Implicit ARIA role | No corresponding role |
| Permitted ARIA roles | No `role` permitted |
| DOM interface | `HTMLMetaElement` |

The type of metadata provided by the `<meta>` element can be one of the following:

* If the `name` attribute is set, the `<meta>` element provides *document-level metadata*, applying to the whole page.
* If the `http-equiv` attribute is set, the `<meta>` element is a *pragma directive*, providing information equivalent to what can be given by a similarly-named HTTP header.
* If the `charset` attribute is set, the `<meta>` element is a *charset declaration*, giving the character encoding in which the document is encoded.
* If the `itemprop` attribute is set, the `<meta>` element provides *user-defined metadata*.
Attributes
----------

This element includes the global attributes.

**Note:** the attribute `name` has a specific meaning for the `<meta>` element, and the `itemprop` attribute must not be set on the same `<meta>` element that has any existing `name`, `http-equiv` or `charset` attributes.

`charset`

This attribute declares the document's character encoding. If the attribute is present, its value must be an ASCII case-insensitive match for the string `"utf-8"`, because UTF-8 is the only valid encoding for HTML5 documents. `<meta>` elements which declare a character encoding must be located entirely within the first 1024 bytes of the document.

`content`

This attribute contains the value for the `http-equiv` or `name` attribute, depending on which is used.

`http-equiv`

Defines a pragma directive. The attribute is named `http-equiv(alent)` because all the allowed values are names of particular HTTP headers:

* `content-security-policy`
 Allows page authors to define a content policy for the current page. Content policies mostly specify allowed server origins and script endpoints which help guard against cross-site scripting attacks.
* `content-type`
 Declares the MIME type and the document's character encoding. The `content` attribute must have the value `"text/html; charset=utf-8"` if specified. This is equivalent to a `<meta>` element with the `charset` attribute specified and carries the same restriction on placement within the document. **Note:** Can only be used in documents served with a `text/html` — not in documents served with an XML MIME type.
* `default-style`
 Sets the name of the default CSS style sheet set.
* `x-ua-compatible`
 If specified, the `content` attribute must have the value `"IE=edge"`. User agents are required to ignore this pragma.
* `refresh` This instruction specifies:
    + The number of seconds until the page should be reloaded - only if the `content` attribute contains a non-negative integer.
    + The number of seconds until the page should redirect to another - only if the `content` attribute contains a non-negative integer followed by the string '`;url=`', and a valid URL.
**Warning:**

Pages set with a `refresh` value run the risk of having the time interval being too short. People navigating with the aid of assistive technology such as a screen reader may be unable to read through and understand the page's content before being automatically redirected. The abrupt, unannounced updating of the page content may also be disorienting for people experiencing low vision conditions.

    + MDN Understanding WCAG, Guideline 2.2 explanations
    + MDN Understanding WCAG, Guideline 3.2 explanations
    + Understanding Success Criterion 2.2.1 | W3C Understanding WCAG 2.0
    + Understanding Success Criterion 2.2.4 | W3C Understanding WCAG 2.0
    + Understanding Success Criterion 3.2.5 | W3C Understanding WCAG 2.0

`name`

The `name` and `content` attributes can be used together to provide document metadata in terms of name-value pairs, with the `name` attribute giving the metadata name, and the `content` attribute giving the value.

See standard metadata names for details about the set of standard metadata names defined in the HTML specification.

Examples
--------

```html
<meta charset="utf-8" />

<!-- Redirect page after 3 seconds -->
<meta http-equiv="refresh" content="3;url=https://www.mozilla.org" />
```

Specifications
--------------

| Specification |
| --- |
| HTML Standard # the-meta-element |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* Standard metadata names
* Learn: `<meta>`
* The viewport meta tag


<a>: The Anchor element - HTML: HyperText Markup Language

<a>: The Anchor element
=======================

The **`<a>`** HTML element (or *anchor* element), with its `href` attribute, creates a hyperlink to web pages, files, email addresses, locations in the same page, or anything else a URL can address.

Content within each `<a>` *should* indicate the link's destination. If the `href` attribute is present, pressing the enter key while focused on the `<a>` element will activate it.

Try it
------

Attributes
----------

This element's attributes include the global attributes.

`download`

Causes the browser to treat the linked URL as a download. Can be used with or without a `filename` value:

* Without a value, the browser will suggest a filename/extension, generated from various sources:
    + The `Content-Disposition` HTTP header
    + The final segment in the URL path
    + The media type (from the `Content-Type` header, the start of a `data:` URL, or `Blob.type` for a `blob:` URL)
* `filename`: defining a value suggests it as the filename. `/` and `\` characters are converted to underscores (`_`). Filesystems may forbid other characters in filenames, so browsers will adjust the suggested name if necessary.

**Note:**

* `download` only works for same-origin URLs, or the `blob:` and `data:` schemes.
* How browsers treat downloads varies by browser, user settings, and other factors. The user may be prompted before a download starts, or the file may be saved automatically, or it may open automatically, either in an external application or in the browser itself.
* If the `Content-Disposition` header has different information from the `download` attribute, resulting behavior may differ:
    + If the header specifies a `filename`, it takes priority over a filename specified in the `download` attribute.
    + If the header specifies a disposition of `inline`, Chrome and Firefox prioritize the attribute and treat it as a download. Old Firefox versions (before 82) prioritize the header and will display the content inline.

`href`

The URL that the hyperlink points to. Links are not restricted to HTTP-based URLs — they can use any URL scheme supported by browsers:

* Sections of a page with document fragments
* Specific text portions with text fragments
* Pieces of media files with media fragments
* Telephone numbers with `tel:` URLs
* Email addresses with `mailto:` URLs
* SMS text messages with `sms:` URLs
* While web browsers may not support other URL schemes, websites can with `registerProtocolHandler()`

`hreflang`

Hints at the human language of the linked URL. No built-in functionality. Allowed values are the same as the global `lang` attribute.

`ping`

A space-separated list of URLs. When the link is followed, the browser will send `POST` requests with the body `PING` to the URLs. Typically for tracking.

`referrerpolicy`

How much of the referrer to send when following the link.

* `no-referrer`: The `Referer` header will not be sent.
* `no-referrer-when-downgrade`: The `Referer` header will not be sent to origins without TLS (HTTPS).
* `origin`: The sent referrer will be limited to the origin of the referring page: its scheme, host, and port.
* `origin-when-cross-origin`: The referrer sent to other origins will be limited to the scheme, the host, and the port. Navigations on the same origin will still include the path.
* `same-origin`: A referrer will be sent for same origin, but cross-origin requests will contain no referrer information.
* `strict-origin`: Only send the origin of the document as the referrer when the protocol security level stays the same (HTTPS→HTTPS), but don't send it to a less secure destination (HTTPS→HTTP).
* `strict-origin-when-cross-origin` (default): Send a full URL when performing a same-origin request, only send the origin when the protocol security level stays the same (HTTPS→HTTPS), and send no header to a less secure destination (HTTPS→HTTP).
* `unsafe-url`: The referrer will include the origin *and* the path (but not the fragment, password, or username). **This value is unsafe**, because it leaks origins and paths from TLS-protected resources to insecure origins.

`rel`

The relationship of the linked URL as space-separated link types.

`target`

Where to display the linked URL, as the name for a *browsing context* (a tab, window, or `<iframe>`). The following keywords have special meanings for where to load the URL:

* `_self`: the current browsing context. (Default)
* `_blank`: usually a new tab, but users can configure browsers to open a new window instead.
* `_parent`: the parent browsing context of the current one. If no parent, behaves as `_self`.
* `_top`: the topmost browsing context (the "highest" context that's an ancestor of the current one). If no ancestors, behaves as `_self`.

**Note:** Setting `target="_blank"` on `<a>` elements implicitly provides the same `rel` behavior as setting `rel="noopener"` which does not set `window.opener`.

`type`

Hints at the linked URL's format with a MIME type. No built-in functionality.

### Deprecated attributes

`charset`
Deprecated

Hinted at the character encoding of the linked URL.

**Note:** This attribute is deprecated and **should not be used by authors**. Use the HTTP `Content-Type` header on the linked URL.

`coords`
Deprecated

Used with the `shape` attribute. A comma-separated list of coordinates.

`name`
Deprecated

Was required to define a possible target location in a page. In HTML 4.01, `id` and `name` could both be used on `<a>`, as long as they had identical values.

**Note:** Use the global attribute `id` instead.

`rev`
Deprecated

Specified a reverse link; the opposite of the `rel` attribute. Deprecated for being very confusing.

`shape`
Deprecated

The shape of the hyperlink's region in an image map.

**Note:** Use the `<area>` element for image maps instead.

Examples
--------

### Linking to an absolute URL

#### HTML

```html
<a href="https://www.mozilla.com">Mozilla</a>
```

#### Result

### Linking to relative URLs

#### HTML

```html
<a href="//example.com">Scheme-relative URL</a>
<a href="/en-US/docs/Web/HTML">Origin-relative URL</a>
<a href="./p">Directory-relative URL</a>
```

```
a {
  display: block;
  margin-bottom: 0.5em;
}
```

#### Result

### Linking to an element on the same page

```html
<!-- <a> element links to the section below -->
<p><a href="#Section\_further\_down">Jump to the heading below</a></p>

<!-- Heading to link to -->
<h2 id="Section\_further\_down">Section further down</h2>
```

#### Result

**Note:** You can use `href="#top"` or the empty fragment (`href="#"`) to link to the top of the current page, as defined in the HTML specification.

### Linking to an email address

To create links that open in the user's email program to let them send a new message, use the `mailto:` scheme:

```html
<a href="mailto:nowhere@mozilla.org">Send email to nowhere</a>
```

#### Result

For details about `mailto:` URLs, such as including a subject or body, see Email links or RFC 6068.

### Linking to telephone numbers

```html
<a href="tel:+49.157.0156">+49 157 0156</a>
<a href="tel:+1(800)555-0123">(800) 555-0123</a>
```

#### Result

`tel:` link behavior varies with device capabilities:

* Cellular devices autodial the number.
* Most operating systems have programs that can make calls, like Skype or FaceTime.
* Websites can make phone calls with `registerProtocolHandler`, such as `web.skype.com`.
* Other behaviors include saving the number to contacts, or sending the number to another device.

See RFC 3966 for syntax, additional features, and other details about the `tel:` URL scheme.

### Using the download attribute to save a <canvas> as a PNG

To save a `<canvas>` element's contents as an image, you can create a link where the `href` is the canvas data as a `data:` URL created with JavaScript and the `download` attribute provides the file name for the downloaded PNG file:

#### Example painting app with save link

##### HTML

```html
<p>
  Paint by holding down the mouse button and moving it.
  <a href="" download="my\_painting.png">Download my painting</a>
</p>

<canvas width="300" height="300"></canvas>
```

##### CSS

```css
html {
  font-family: sans-serif;
}
canvas {
  background: #fff;
  border: 1px dashed;
}
a {
  display: inline-block;
  background: #69c;
  color: #fff;
  padding: 5px 10px;
}
```

##### JavaScript

```js
const canvas = document.querySelector("canvas");
const c = canvas.getContext("2d");
c.fillStyle = "hotpink";
let isDrawing;

function draw(x, y) {
  if (isDrawing) {
    c.beginPath();
    c.arc(x, y, 10, 0, Math.PI \* 2);
    c.closePath();
    c.fill();
  }
}

canvas.addEventListener("mousemove", (event) =>
  draw(event.offsetX, event.offsetY),
);
canvas.addEventListener("mousedown", () => (isDrawing = true));
canvas.addEventListener("mouseup", () => (isDrawing = false));

document
  .querySelector("a")
  .addEventListener(
    "click",
    (event) => (event.target.href = canvas.toDataURL()),
  );
```

##### Result

Security and privacy
--------------------

`<a>` elements can have consequences for users' security and privacy. See `Referer` header: privacy and security concerns for information.

Using `target="_blank"` without `rel="noreferrer"` and `rel="noopener"` makes the website vulnerable to `window.opener` API exploitation attacks, although note that, in newer browser versions setting `target="_blank"` implicitly provides the same protection as setting `rel="noopener"`. See browser compatibility for details.

Accessibility concerns
----------------------

### Strong link text

**The content inside a link should indicate where the link goes**, even out of context.

#### Inaccessible, weak link text

A sadly common mistake is to only link the words "click here" or "here":

```html
<p>Learn more about our products <a href="/products">here</a>.</p>
```

##### Result

#### Strong link text

Luckily, this is an easy fix, and it's actually shorter than the inaccessible version!

```html
<p>Learn more <a href="/products">about our products</a>.</p>
```

##### Result

Assistive software has shortcuts to list all links on a page. However, strong link text benefits all users — the "list all links" shortcut emulates how sighted users quickly scan pages.

### onclick events

Anchor elements are often abused as fake buttons by setting their `href` to `#` or `javascript:void(0)` to prevent the page from refreshing, then listening for their `click` events .

These bogus `href` values cause unexpected behavior when copying/dragging links, opening links in a new tab/window, bookmarking, or when JavaScript is loading, errors, or is disabled. They also convey incorrect semantics to assistive technologies, like screen readers.

Use a `<button>` instead. In general, **you should only use a hyperlink for navigation to a real URL**.

### External links and linking to non-HTML resources

Links that open in a new tab/window via `target="_blank"`, or links that point to a download file should indicate what will happen when the link is followed.

People experiencing low vision conditions, navigating with the aid of screen reading technology, or with cognitive concerns may be confused when a new tab, window, or application opens unexpectedly. Older screen-reading software may not even announce the behavior.

#### Link that opens a new tab/window

```html
<a target="\_blank" href="https://www.wikipedia.org">
  Wikipedia (opens in new tab)
</a>
```

##### Result

#### Link to a non-HTML resource

```html
<a href="2017-annual-report.ppt">2017 Annual Report (PowerPoint)</a>
```

If an icon is used to signify link behavior, make sure it has an *alt text*:

```html
<a target="\_blank" href="https://www.wikipedia.org">
  Wikipedia
  <img alt="(opens in new tab)" src="newtab.svg" />
</a>

<a href="2017-annual-report.ppt">
  2017 Annual Report
  <img alt="(PowerPoint file)" src="ppt-icon.svg" />
</a>
```

##### Result

* WebAIM: Links and Hypertext - Hypertext Links
* MDN / Understanding WCAG, Guideline 3.2
* G200: Opening new windows and tabs from a link only when necessary
* G201: Giving users advanced warning when opening a new window
### Skip links

A **skip link** is a link placed as early as possible in `<body>` content that points to the beginning of the page's main content. Usually, CSS hides a skip link offscreen until focused.

```html
<body>
  <a href="#content" class="skip-link">Skip to main content</a>

  <header>…</header>

  <!-- The skip link jumps to here -->
  <main id="content"></main>
</body>
```

```css
.skip-link {
  position: absolute;
  top: -3em;
  background: #fff;
}
.skip-link:focus {
  top: 0;
}
```

#### Result

Skip links let keyboard users bypass content repeated throughout multiple pages, such as header navigation.

Skip links are especially useful for people who navigate with the aid of assistive technology such as switch control, voice command, or mouth sticks/head wands, where the act of moving through repetitive links can be laborious.

* WebAIM: "Skip Navigation" Links
* How-to: Use Skip Navigation links
* MDN / Understanding WCAG, Guideline 2.4 explanations
* Understanding Success Criterion 2.4.1
### Size and proximity

#### Size

Interactive elements, like links, should provide an area large enough that it is easy to activate them. This helps a variety of people, including those with motor control issues and those using imprecise inputs such as a touchscreen. A minimum size of 44×44 CSS pixels is recommended.

Text-only links in prose content are exempt from this requirement, but it's still a good idea to make sure enough text is hyperlinked to be easily activated.

* Understanding Success Criterion 2.5.5: Target Size
* Target Size and 2.5.5
* Quick test: Large touch targets

#### Proximity

Interactive elements, like links, placed in close visual proximity should have space separating them. Spacing helps people with motor control issues, who may otherwise accidentally activate the wrong interactive content.

Spacing may be created using CSS properties like `margin`.

* Hand tremors and the giant-button-problem
Technical summary
-----------------

|  |  |
| --- | --- |
| Content categories | Flow content,
 phrasing content,
 interactive content, palpable content.
  |
| Permitted content | Transparent, except that no descendant may be
 interactive content or an
 a element, and no descendant may have a specified
 tabindex attribute.
  |
| Tag omission | None, both the starting and ending tag are mandatory. |
| Permitted parents |
 Any element that accepts
 flow content, but not other `<a>` elements.
  |
| Implicit ARIA role | `link` when `href` attribute is
 present, otherwise
 `generic` |
| Permitted ARIA roles | When `href` attribute is present:* `button`
* `checkbox`
* `menuitem`
* `menuitemcheckbox`
* `menuitemradio`
* `option`
* `radio`
* `switch`
* `tab`
* `treeitem`

When `href` attribute is not present:* any
 |
| DOM interface | `HTMLAnchorElement` |

Specifications
--------------

| Specification |
| --- |
| HTML Standard # the-a-element |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `<link>` is similar to `<a>`, but for metadata hyperlinks that are invisible to users.
* `:link` is a CSS pseudo-class that will match `<a>` elements with URL in `href` attribute that was not yet visited by the user.
* `:visited` is a CSS pseudo-class that will match `<a>` elements with URL in `href` attribute that was visited by the user in the past.
* `:any-link` is a CSS pseudo-class that will match `<a>` elements with `href` attribute.
* Text fragments are user-agent instructions added to URLs that allow content authors to link to specific text on a page, without IDs being required.


<base>: The Document Base URL element - HTML: HyperText Markup Language

<base>: The Document Base URL element
=====================================

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.

A document's used base URL can be accessed by scripts with `Node.baseURI`. If the document has no `<base>` elements, then `baseURI` defaults to `location.href`.

|  |  |
| --- | --- |
| Content categories | Metadata content. |
| Permitted content | None; it is a void element. |
| Tag omission | There must be no closing tag. |
| Permitted parents | A `<head>` that doesn't contain another `<base>` element. |
| Implicit ARIA role | No corresponding role |
| Permitted ARIA roles | No `role` permitted |
| DOM interface | `HTMLBaseElement` |

Attributes
----------

This element's attributes include the global attributes.

**Warning:** A `<base>` element must have an `href` attribute, a `target` attribute, or both.
 If at least one of these attributes are specified, the `<base>` element **must** come before other elements with attribute values that are URLs, such as a `<link>`'s `href` attribute.

`href`

 The base URL to be used throughout the document for relative URLs.
 Absolute and relative URLs are allowed.
 `data:` and `javascript:` URLs are not allowed.

`target`

A **keyword** or **author-defined name** of the default browsing context to show the results of navigation from `<a>`, `<area>`, or `<form>` elements without explicit `target` attributes. The following keywords have special meanings:

* `_self` (default): Show the result in the current browsing context.
* `_blank`: Show the result in a new, unnamed browsing context.
* `_parent`: Show the result in the parent browsing context of the current one, if the current page is inside a frame. If there is no parent, acts the same as `_self`.
* `_top`: Show the result in the topmost browsing context (the browsing context that is an ancestor of the current one and has no parent). If there is no parent, acts the same as `_self`.

Usage notes
-----------

### Multiple <base> elements

If multiple `<base>` elements are used, only the first `href` and first `target` are obeyed — all others are ignored.

### In-page anchors

Links pointing to a fragment in the document — e.g. `<a href="#some-id">` — are resolved with the `<base>`, triggering an HTTP request to the base URL with the fragment attached.

For example, given `<base href="https://example.com/">` and this link: `<a href="#anchor">To anchor</a>`. The link points to `https://example.com/#anchor`.

### Open Graph

Open Graph tags do not acknowledge `<base>`, and should always have full absolute URLs. For example:

```html
<meta property="og:image" content="https://example.com/thumbnail.jpg" />
```

Examples
--------

```html
<base href="https://www.example.com/" />
<base target="\_blank" />
<base target="\_top" href="https://example.com/" />
```

Specifications
--------------

| Specification |
| --- |
| HTML Standard # the-base-element |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.


<label>: The Label element - HTML: HyperText Markup Language

<label>: The Label element
==========================

The **`<label>`** HTML element represents a caption for an item in a user interface.

Try it
------

Associating a `<label>` with a form control, such as `<input>` or `<textarea>` offers some major advantages:

* The label text is not only visually associated with its corresponding text input; it is programmatically associated with it too. This means that, for example, a screen reader will read out the label when the user is focused on the form input, making it easier for an assistive technology user to understand what data should be entered.
* When a user clicks or touches/taps a label, the browser passes the focus to its associated input (the resulting event is also raised for the input). That increased hit area for focusing the input provides an advantage to anyone trying to activate it — including those using a touch-screen device.

To explicitly associate a `<label>` element with an `<input>` element, you first need to add the `id` attribute to the `<input>` element. Next, you add the `for` attribute to the `<label>` element, where the value of `for` is the same as the `id` in the `<input>` element.

Alternatively, you can nest the `<input>` directly inside the `<label>`, in which case the `for` and `id` attributes are not needed because the association is implicit:

```html
<label>
  Do you like peas?
  <input type="checkbox" name="peas" />
</label>
```

The form control that a label is labeling is called the *labeled control* of the label element. Multiple labels can be associated with the same form control:

```html
<label for="username">Enter your username:</label>
<input id="username" name="username" type="text" />
<label for="username">Forgot your username?</label>
```

Elements that can be associated with a `<label>` element include `<button>`, `<input>` (except for `type="hidden"`), `<meter>`, `<output>`, `<progress>`, `<select>` and `<textarea>`.

Attributes
----------

This element includes the global attributes.

`for`

The value of the `for` attribute must be a single `id` for a labelable form-related element in the same document as the `<label>` element. So, any given `label` element can be associated with only one form control.

**Note:** To programmatically set the `for` attribute, use `htmlFor`.

The first element in the document with an `id` attribute matching the value of the `for` attribute is the *labeled control* for this `label` element — if the element with that `id` is actually a labelable element. If it is *not* a labelable element, then the `for` attribute has no effect. If there are other elements that also match the `id` value, later in the document, they are not considered.

Multiple `label` elements can be given the same value for their `for` attribute; doing so causes the associated form control (the form control that `for` value references) to have multiple labels.

**Note:** A `<label>` element can have both a `for` attribute and a contained control element, as long as the `for` attribute points to the contained control element.

Styling with CSS
----------------

There are no special styling considerations for `<label>` elements — structurally they are simple inline elements, and so can be styled in much the same way as a `<span>` or `<a>` element. You can apply styling to them in any way you want, as long as you don't cause the text to become difficult to read.

Examples
--------

### Defining an implicit label

```html
<label>Click me <input type="text" /></label>
```

### Defining an explicit label with the "for" attribute

```html
<label for="username">Click me to focus on the input field</label>
<input type="text" id="username" />
```

Accessibility concerns
----------------------

### Interactive content

Don't place interactive elements such as anchors or buttons inside a `label`. Doing so makes it difficult for people to activate the form input associated with the `label`.

**Don't do this:**

```html
<label for="tac">
  <input id="tac" type="checkbox" name="terms-and-conditions" />
  I agree to the <a href="terms-and-conditions.html">Terms and Conditions</a>
</label>
```

**Prefer this:**

```html
<label for="tac">
  <input id="tac" type="checkbox" name="terms-and-conditions" />
  I agree to the Terms and Conditions
</label>
<p>
  <a href="terms-and-conditions.html">Read our Terms and Conditions</a>
</p>
```

### Headings

Placing heading elements within a `<label>` interferes with many kinds of assistive technology, because headings are commonly used as a navigation aid. If the label's text needs to be adjusted visually, use CSS classes applied to the `<label>` element instead.

If a form, or a section of a form needs a title, use the `<legend>` element placed within a `<fieldset>`.

**Don't do this:**

```html
<label for="your-name">
  <h3>Your name</h3>
  <input id="your-name" name="your-name" type="text" />
</label>
```

**Prefer this:**

```html
<label class="large-label" for="your-name">
  Your name
  <input id="your-name" name="your-name" type="text" />
</label>
```

### Buttons

An `<input>` element with a `type="button"` declaration and a valid `value` attribute does not need a label associated with it. Doing so may actually interfere with how assistive technology parses the button input. The same applies for the `<button>` element.

Technical summary
-----------------

|  |  |
| --- | --- |
| Content categories | Flow content,
 phrasing content,
 interactive content,
 form-associated element, palpable content.
  |
| Permitted content | Phrasing content, but no descendant `label` elements. No
 labelable
 elements other than the labeled control are allowed.
  |
| Tag omission | None, both the starting and ending tag are mandatory. |
| Permitted parents |
 Any element that accepts
 phrasing content.
  |
| Implicit ARIA role | No corresponding role |
| Permitted ARIA roles | No `role` permitted |
| DOM interface | `HTMLLabelElement` |

Specifications
--------------

| Specification |
| --- |
| HTML Standard # the-label-element |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.


<menu>: The Menu element - HTML: HyperText Markup Language

<menu>: The Menu element
========================

The **`<menu>`** HTML element is described in the HTML specification as a semantic alternative to `<ul>`, but treated by browsers (and exposed through the accessibility tree) as no different than `<ul>`. It represents an unordered list of items (which are represented by `<li>` elements).

Try it
------

Attributes
----------

This element only includes the global attributes.

Usage notes
-----------

The `<menu>` and `<ul>` elements both represent an unordered list of items. The key difference is that `<ul>` primarily contains items for display, while `<menu>` was intended for interactive items. The related `<menuitem>` element has been deprecated.

**Note:** In early versions of the HTML specification, the `<menu>` element had an additional use case as a context menu. This functionality is considered obsolete and is not in the specification.

Examples
--------

### Toolbar

In this example, a `<menu>` is used to create a toolbar for an editing application.

#### HTML

```html
<menu>
  <li><button onclick="copy()">Copy</button></li>
  <li><button onclick="cut()">Cut</button></li>
  <li><button onclick="paste()">Paste</button></li>
</menu>
```

Note that this is functionally no different from:

```html
<ul>
  <li><button onclick="copy()">Copy</button></li>
  <li><button onclick="cut()">Cut</button></li>
  <li><button onclick="paste()">Paste</button></li>
</ul>
```

#### CSS

```css
menu,
ul {
  display: flex;
  list-style: none;
  padding: 0;
  width: 400px;
}

li {
  flex-grow: 1;
}

button {
  width: 100%;
}
```

#### Result

Technical summary
-----------------

|  |  |
| --- | --- |
| Content categories |
Flow content. If the element's children include at least one
 `<li>` element:
 Palpable content.
  |
| Permitted content |
 Zero or more occurrences of `<li>`,
 `<script>`, and
 `<template>`.
  |
| Tag omission | None, both the starting and ending tag are mandatory. |
| Permitted parents |
 Any element that accepts
 flow content.
  |
| Implicit ARIA role | `list` |
| Permitted ARIA roles | `directory`, `group`,
 `listbox`, `menu`, `menubar`,
 `none`, `presentation`,
 `radiogroup`, `tablist`,
 `toolbar` or `tree` |
| DOM interface | `HTMLMenuElement` |

Specifications
--------------

| Specification |
| --- |
| HTML Standard # the-menu-element |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* Other list-related HTML Elements: `<ol>`, `<ul>`, and `<li>`.


<blockquote>: The Block Quotation element - HTML: HyperText Markup Language

<blockquote>: The Block Quotation element
=========================================

The **`<blockquote>`** HTML element indicates that the enclosed text is an extended quotation. Usually, this is rendered visually by indentation (see Notes for how to change it). A URL for the source of the quotation may be given using the `cite` attribute, while a text representation of the source can be given using the `<cite>` element.

Try it
------

Attributes
----------

This element's attributes include the global attributes.

`cite`

A URL that designates a source document or message for the information quoted. This attribute is intended to point to information explaining the context or the reference for the quote.

Usage notes
-----------

To change the indentation applied to the quoted text, use the CSS `margin-left` and/or `margin-right` properties, or the `margin` shorthand property.

To include shorter quotes inline rather than in a separate block, use the `<q>` (Quotation) element.

Examples
--------

This example demonstrates the use of the `<blockquote>` element to quote a passage from RFC 1149, *A Standard for the Transmission of IP Datagrams on Avian Carriers*.

```html
<blockquote cite="https://datatracker.ietf.org/doc/html/rfc1149">
  <p>
    Avian carriers can provide high delay, low throughput, and low altitude
    service. The connection topology is limited to a single point-to-point path
    for each carrier, used with standard carriers, but many carriers can be used
    without significant interference with each other, outside early spring. This
    is because of the 3D ether space available to the carriers, in contrast to
    the 1D ether used by IEEE802.3. The carriers have an intrinsic collision
    avoidance system, which increases availability.
  </p>
</blockquote>
```

### Result

Technical summary
-----------------

|  |  |
| --- | --- |
| Content categories | Flow content, sectioning root, palpable content. |
| Permitted content | Flow content. |
| Tag omission | None, both the starting and ending tag are mandatory. |
| Permitted parents |
 Any element that accepts
 flow content.
  |
| Implicit ARIA role | `blockquote` |
| Permitted ARIA roles | Any |
| DOM interface | `HTMLQuoteElement` |

Specifications
--------------

| Specification |
| --- |
| HTML Standard # the-blockquote-element |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* The `<q>` element for inline quotations.
* The `<cite>` element for source citations.


<thead>: The Table Head element - HTML: HyperText Markup Language

<thead>: The Table Head element
===============================

The **`<thead>`** HTML element defines a set of rows defining the head of the columns of the table.

Try it
------

Attributes
----------

This element includes the global attributes.

### Deprecated attributes

`align`
Deprecated

This enumerated attribute specifies how horizontal alignment of each cell content will be handled. Possible values are:

* `left`, aligning the content to the left of the cell
* `center`, centering the content in the cell
* `right`, aligning the content to the right of the cell
* `justify`, inserting spaces into the textual content so that the content is justified in the cell
* `char`, aligning the textual content on a special character with a minimal offset, defined by the `char` and `charoff` attributes.

If this attribute is not set, the `left` value is assumed.

**Warning:** Do not use this attribute as it is obsolete (not supported) in the latest standard.

* To align values, use the CSS `text-align` property instead.

`bgcolor`
Deprecated

This attribute defines the background color of each column cell. It accepts a 6-digit hexadecimal color or a named color. Alpha transparency is not supported.

**Note:** Do not use this attribute, as it is non-standard. The `thead` element should be styled using the CSS `background-color` property, which can be applied to any element, including the `thead`, `<tr>`, `<td>` and `<th>` elements.

`char`
Deprecated

This attribute is used to set the character to align the cells in a column on. Typical values for this include a period (.) when attempting to align numbers or monetary values. If `align` is not set to `char`, this attribute is ignored.

**Note:** Do not use this attribute as it is obsolete (and not supported) in the latest standard.

`charoff`
Deprecated

This attribute is used to indicate the number of characters to offset the column data from the alignment characters specified by the **char** attribute.

**Note:** Do not use this attribute as it is obsolete (and not supported) in the latest standard.

`valign`
Deprecated

This attribute specifies the vertical alignment of the text within each row of cells of the table header. Possible values for this attribute are:

* `baseline`, which will put the text as close to the bottom of the cell as it is possible, but align it on the baseline of the characters instead of the bottom of them. If characters are all of the size, this has the same effect as `bottom`.
* `bottom`, which will put the text as close to the bottom of the cell as it is possible;
* `middle`, which will center the text in the cell;
* `top`, which will put the text as close to the top of the cell as it is possible.

**Note:** Do not use this attribute as it is obsolete (and not supported) in the latest standard: instead set the CSS `vertical-align` property on it.

Examples
--------

See `<table>` for examples on `<thead>`.

Technical summary
-----------------

|  |  |
| --- | --- |
| Content categories | None. |
| Permitted content | Zero or more `<tr>` elements. |
| Tag omission |
 The start tag is mandatory. The end tag may be omitted if the
 `<thead>` element is immediately followed by a
 `<tbody>` or `<tfoot>`
 element.
  |
| Permitted parents |
 A `<table>` element. The
 `<thead>` must appear after any
 `<caption>` or
 `<colgroup>` element, even implicitly defined,
 but before any `<tbody>`,
 `<tfoot>` and `<tr>`
 element.
  |
| Implicit ARIA role | `rowgroup` |
| Permitted ARIA roles | Any |
| DOM interface | `HTMLTableSectionElement` |

Specifications
--------------

| Specification |
| --- |
| HTML Standard # the-thead-element |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* Other table-related HTML Elements: `<caption>`, `<col>`, `<colgroup>`, `<table>`, `<tbody>`, `<td>`, `<tfoot>`, `<th>`, `<tr>`;
* CSS properties and pseudo-classes that may be specially useful to style the `<thead>` element:
    + the `:nth-child` pseudo-class to set the alignment on the cells of the column;
    + the `text-align` property to align all cells content on the same character, like '.'.


<abbr>: The Abbreviation element - HTML: HyperText Markup Language

<abbr>: The Abbreviation element
================================

The **`<abbr>`** HTML element represents an abbreviation or acronym.

When including an abbreviation or acronym, provide a full expansion of the term in plain text on first use, along with the `<abbr>` to mark up the abbreviation. This informs the user what the abbreviation or acronym means.

The optional `title` attribute can provide an expansion for the abbreviation or acronym when a full expansion is not present. This provides a hint to user agents on how to announce/display the content while informing all users what the abbreviation means. If present, `title` must contain this full description and nothing else.

Try it
------

Attributes
----------

This element only supports the global attributes. The `title` attribute has a specific semantic meaning when used with the `<abbr>` element; it *must* contain a full human-readable description or expansion of the abbreviation. This text is often presented by browsers as a tooltip when the mouse cursor is hovered over the element.

Each `<abbr>` element you use is independent of all others; providing a `title` for one does not automatically attach the same expansion text to others with the same content text.

Usage notes
-----------

### Typical use cases

It's certainly not required that all abbreviations be marked up using `<abbr>`. There are, though, a few cases where it's helpful to do so:

* When an abbreviation is used and you want to provide an expansion or definition outside the flow of the document's content, use `<abbr>` with an appropriate `title`.
* To define an abbreviation which may be unfamiliar to the reader, present the term using `<abbr>` and inline text providing the definition. Include a `title` attribute only when the inline expansion or definition is not available.
* When an abbreviation's presence in the text needs to be semantically noted, the `<abbr>` element is useful. This can be used, in turn, for styling or scripting purposes.
* You can use `<abbr>` in concert with `<dfn>` to establish definitions for terms which are abbreviations or acronyms. See the example Defining an abbreviation below.
### Grammar considerations

In languages with grammatical number (that is, languages where the number of items affects the grammar of a sentence), use the same grammatical number in your `title` attribute as inside your `<abbr>` element. This is especially important in languages with more than two numbers, such as Arabic, but is also relevant in English.

Default styling
---------------

The purpose of this element is purely for the convenience of the author and all browsers display it inline (`display``: inline`) by default, though its default styling varies from one browser to another:

Some browsers add a dotted underline to the content of the element. Others add a dotted underline while converting the contents to small caps. Others may not style it differently than a `<span>` element. To control this styling, use `text-decoration` and `font-variant`.

Examples
--------

### Marking up an abbreviation semantically

To mark up an abbreviation without providing an expansion or description, use `<abbr>` without any attributes, as seen in this example.

#### HTML

```html
<p>Using <abbr>HTML</abbr> is fun and easy!</p>
```

#### Result

### Styling abbreviations

You can use CSS to set a custom style to be used for abbreviations, as seen in this simple example.

#### HTML

```html
<p>Using <abbr>CSS</abbr>, you can style your abbreviations!</p>
```

#### CSS

```css
abbr {
  font-variant: all-small-caps;
}
```

#### Result

### Providing an expansion

Adding a `title` attribute lets you provide an expansion or definition for the abbreviation or acronym.

#### HTML

```html
<p>Ashok's joke made me <abbr title="Laugh Out Loud">LOL</abbr> big time.</p>
```

#### Result

### Defining an abbreviation

You can use `<abbr>` in tandem with `<dfn>` to more formally define an abbreviation, as shown here.

#### HTML

```html
<p>
  <dfn id="html"><abbr title="HyperText Markup Language">HTML</abbr> </dfn> is a
  markup language used to create the semantics and structure of a web page.
</p>

<p>
  A <dfn id="spec">Specification</dfn> (<abbr>spec</abbr>) is a document that
  outlines in detail how a technology or API is intended to function and how it
  is accessed.
</p>
```

#### Result

### Accessibility concerns

Spelling out the acronym or abbreviation in full the first time it is used on a page is beneficial for helping people understand it, especially if the content is technical or industry jargon.

Only include a `title` if expanding the abbreviation or acronym in the text is not possible. Having a difference between the announced word or phrase and what is displayed on the screen, especially if it's technical jargon the reader may not be familiar with, can be jarring.

#### HTML

```html
<p>
  JavaScript Object Notation (<abbr>JSON</abbr>) is a lightweight
  data-interchange format.
</p>
```

#### Result

This is especially helpful for people who are unfamiliar with the terminology or concepts discussed in the content, people who are new to the language, and people with cognitive concerns.

Technical summary
-----------------

|  |  |
| --- | --- |
| Content categories | Flow content,
 phrasing content, palpable content
  |
| Permitted content | Phrasing content |
| Tag omission | None, both the starting and ending tag are mandatory. |
| Permitted parents |
 Any element that accepts
 phrasing content |
| Implicit ARIA role | No corresponding role |
| Permitted ARIA roles | Any |
| DOM Interface | `HTMLElement` |

Specifications
--------------

| Specification |
| --- |
| HTML Standard # the-abbr-element |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* Using the `<abbr>` element


<small>: the side comment element - HTML: HyperText Markup Language

<small>: the side comment element
=================================

The **`<small>`** HTML element represents side-comments and small print, like copyright and legal text, independent of its styled presentation. By default, it renders text within it one font-size smaller, such as from `small` to `x-small`.

Try it
------

Attributes
----------

This element only includes the global attributes.

Examples
--------

### Basic usage

```html
<p>
  This is the first sentence.
  <small>This whole sentence is in small letters.</small>
</p>
```

#### Result

### CSS alternative

```html
<p>
  This is the first sentence.
  <span style="font-size:0.8em">This whole sentence is in small letters.</span>
</p>
```

#### Result

Notes
-----

Although the `<small>` element, like the `<b>` and `<i>` elements, may be perceived to violate the principle of separation between structure and presentation, all three are valid in HTML. Authors are encouraged to use their best judgement when determining whether to use `<small>` or CSS.

Technical summary
-----------------

|  |  |
| --- | --- |
| Content categories | Flow content,
 phrasing content |
| Permitted content | Phrasing content |
| Tag omission | None; must have both a start tag and an end tag. |
| Permitted parents |
 Any element that accepts
 phrasing content, or any element that accepts
 flow content.
  |
| Implicit ARIA role | `generic` |
| Permitted ARIA roles | Any |
| DOM interface | `HTMLElement` |

Specifications
--------------

| Specification |
| --- |
| HTML Standard # the-small-element |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `<b>`
* `<sub>` and `<sup>`
* `<font>`
* `<style>`
* HTML 4.01 Specification: Font Styles


<script>: The Script element - HTML: HyperText Markup Language

<script>: The Script element
============================

The **`<script>`** HTML element is used to embed executable code or data; this is typically used to embed or refer to JavaScript code. The `<script>` element can also be used with other languages, such as WebGL's GLSL shader programming language and JSON.

|  |  |
| --- | --- |
| Content categories | Metadata content,
 Flow content,
 Phrasing content.
  |
| Permitted content | Dynamic script such as `text/javascript`. |
| Tag omission | None, both the starting and ending tag are mandatory. |
| Permitted parents |
 Any element that accepts metadata content,
 or any element that accepts phrasing content.
  |
| Implicit ARIA role | No corresponding role |
| Permitted ARIA roles | No `role` permitted |
| DOM interface | `HTMLScriptElement` |

Attributes
----------

This element includes the global attributes.

`async`

For classic scripts, if the `async` attribute is present, then the classic script will be fetched in parallel to parsing and evaluated as soon as it is available.

For module scripts, if the `async` attribute is present then the scripts and all their dependencies will be fetched in parallel to parsing and evaluated as soon as they are available.

This attribute allows the elimination of **parser-blocking JavaScript** where the browser would have to load and evaluate scripts before continuing to parse. `defer` has a similar effect in this case.

This is a boolean attribute: the presence of a boolean attribute on an element represents the true value, and the absence of the attribute represents the false value.

See Browser compatibility for notes on browser support. See also Async scripts for asm.js.

`blocking`
Experimental

This attribute explicitly indicates that certain operations should be blocked on the fetching of the script. The operations that are to be blocked must be a space-separated list of blocking attributes listed below.

* `render`: The rendering of content on the screen is blocked.

`crossorigin`

Normal `script` elements pass minimal information to the `window.onerror` for scripts which do not pass the standard CORS checks. To allow error logging for sites which use a separate domain for static media, use this attribute. See CORS settings attributes for a more descriptive explanation of its valid arguments.

`defer`

This Boolean attribute is set to indicate to a browser that the script is meant to be executed after the document has been parsed, but before firing `DOMContentLoaded`.

Scripts with the `defer` attribute will prevent the `DOMContentLoaded` event from firing until the script has loaded and finished evaluating.

**Warning:** This attribute must not be used if the `src` attribute is absent (i.e. for inline scripts), in this case it would have no effect.

The `defer` attribute has no effect on module scripts — they defer by default.

Scripts with the `defer` attribute will execute in the order in which they appear in the document.

This attribute allows the elimination of **parser-blocking JavaScript** where the browser would have to load and evaluate scripts before continuing to parse. `async` has a similar effect in this case.

`fetchpriority`

Provides a hint of the relative priority to use when fetching an external script. Allowed values:

`high`

Signals a high-priority fetch relative to other external scripts.

`low`

Signals a low-priority fetch relative to other external scripts.

`auto`

Default: Signals automatic determination of fetch priority relative to other external scripts.

`integrity`

This attribute contains inline metadata that a user agent can use to verify that a fetched resource has been delivered free of unexpected manipulation. See Subresource Integrity.

`nomodule`

This Boolean attribute is set to indicate that the script should not be executed in browsers that support ES modules — in effect, this can be used to serve fallback scripts to older browsers that do not support modular JavaScript code.

`nonce`

A cryptographic nonce (number used once) to allow scripts in a script-src Content-Security-Policy. The server must generate a unique nonce value each time it transmits a policy. It is critical to provide a nonce that cannot be guessed as bypassing a resource's policy is otherwise trivial.

`referrerpolicy`

Indicates which referrer to send when fetching the script, or resources fetched by the script:

* `no-referrer`: The `Referer` header will not be sent.
* `no-referrer-when-downgrade`: The `Referer` header will not be sent to origins without TLS (HTTPS).
* `origin`: The sent referrer will be limited to the origin of the referring page: its scheme, host, and port.
* `origin-when-cross-origin`: The referrer sent to other origins will be limited to the scheme, the host, and the port. Navigations on the same origin will still include the path.
* `same-origin`: A referrer will be sent for same origin, but cross-origin requests will contain no referrer information.
* `strict-origin`: Only send the origin of the document as the referrer when the protocol security level stays the same (HTTPS→HTTPS), but don't send it to a less secure destination (HTTPS→HTTP).
* `strict-origin-when-cross-origin` (default): Send a full URL when performing a same-origin request, only send the origin when the protocol security level stays the same (HTTPS→HTTPS), and send no header to a less secure destination (HTTPS→HTTP).
* `unsafe-url`: The referrer will include the origin *and* the path (but not the fragment, password, or username). **This value is unsafe**, because it leaks origins and paths from TLS-protected resources to insecure origins.

**Note:** An empty string value (`""`) is both the default value, and a fallback value if `referrerpolicy` is not supported. If `referrerpolicy` is not explicitly specified on the `<script>` element, it will adopt a higher-level referrer policy, i.e. one set on the whole document or domain. If a higher-level policy is not available, the empty string is treated as being equivalent to `strict-origin-when-cross-origin`.

`src`

This attribute specifies the URI of an external script; this can be used as an alternative to embedding a script directly within a document.

**`type`**

 This attribute indicates the type of script represented.
 The value of this attribute will be one of the following:

**Attribute is not set (default), an empty string, or a JavaScript MIME type**

 Indicates that the script is a "classic script", containing JavaScript code.
 Authors are encouraged to omit the attribute if the script refers to JavaScript code rather than specify a MIME type.
 JavaScript MIME types are listed in the IANA media types specification.

`importmap`

 This value indicates that the body of the element contains an import map.
 The import map is a JSON object that developers can use to control how the browser resolves module specifiers when importing JavaScript modules.

`module`

 This value causes the code to be treated as a JavaScript module.
 The processing of the script contents is deferred.
 The `charset` and `defer` attributes have no effect.
 For information on using `module`, see our JavaScript modules guide.
 Unlike classic scripts, module scripts require the use of the CORS protocol for cross-origin fetching.

`speculationrules`
Experimental

 This value indicates that the body of the element contains speculation rules.
 Speculation rules take the form of a JSON object that determine what resources should be prefetched or prerendered by the browser. This is part of the Speculation Rules API.

**Any other value**

 The embedded content is treated as a data block, and won't be processed by the browser.
 Developers must use a valid MIME type that is not a JavaScript MIME type to denote data blocks.
 All of the other attributes will be ignored, including the `src` attribute.

### Deprecated attributes

`charset`
Deprecated

If present, its value must be an ASCII case-insensitive match for "`utf-8`". It's unnecessary to specify the `charset` attribute, because documents must use UTF-8, and the `script` element inherits its character encoding from the document.

`language`
Deprecated

Non-standard

Like the `type` attribute, this attribute identifies the scripting language in use. Unlike the `type` attribute, however, this attribute's possible values were never standardized. The `type` attribute should be used instead.

Notes
-----

Scripts without `async`, `defer` or `type="module"` attributes, as well as inline scripts without the `type="module"` attribute, are fetched and executed immediately before the browser continues to parse the page.

 The script should be served with the `text/javascript` MIME type, but browsers are lenient and only block them if the script is served with an image type (`image/*`), a video type (`video/*`), an audio type (`audio/*`), or `text/csv`.
 If the script is blocked, an `error` event is sent to the element; otherwise, a `load` event is sent.

Examples
--------

### Basic usage

These examples show how to import (an external) script using the `<script>` element.

```html
<script src="javascript.js"></script>
```

And the following examples show how to put (an inline) script inside the `<script>` element.

```html
<script>
 alert("Hello World!");
</script>
```

### Module fallback

Browsers that support the `module` value for the `type` attribute ignore any script with a `nomodule` attribute. That enables you to use module scripts while providing `nomodule`-marked fallback scripts for non-supporting browsers.

```html
<script type="module" src="main.js"></script>
<script nomodule src="fallback.js"></script>
```

### Importing modules with importmap

 When importing modules in scripts, if you don't use the `type=importmap` feature, then each module must be imported using a module specifier that is either an absolute or relative URL.
 In the example below, the first module specifier ("./shapes/square.js") resolves relative to the base URL of the document, while the second is an absolute URL.

```js
import { name as squareName, draw } from "./shapes/square.js";
import { name as circleName } from "https://example.com/shapes/circle.js";
```

 An import map allows you to provide a mapping that, if matched, can replace the text in the module specifier.
 The import map below defines keys `square` and `circle` that can be used as aliases for the module specifiers shown above.

```html
<script type="importmap">
 {
 "imports": {
 "square": "./shapes/square.js",
 "circle": "https://example.com/shapes/circle.js"
 }
 }
</script>
```

This allows us to import modules using names in the module specifier (rather than absolute or relative URLs).

```js
import { name as squareName, draw } from "square";
import { name as circleName } from "circle";
```

For more examples of what you can do with import maps, see the Importing modules using import maps section in the JavaScript modules guide.

### Embedding data in HTML

You can also use the `<script>` element to embed data in HTML with server-side rendering by specifying a valid non-JavaScript MIME type in the `type` attribute.

```html
<!-- Generated by the server -->
<script id="data" type="application/json">
 {
 "userId": 1234,
 "userName": "Maria Cruz",
 "memberSince": "2000-01-01T00:00:00.000Z"
 }
</script>

<!-- Static -->
<script>
 const userInfo = JSON.parse(document.getElementById("data").text);
 console.log("User information: %o", userInfo);
</script>
```

### Blocking rendering till a script is fetched and executed

 You can include `render` token inside a `blocking` attribute;
 the rendering of the page will be blocked till the script is fetched and executed. In the example below, we block rendering on an async script,
 so that the script doesn't block parsing but is guaranteed to be evaluated before rendering starts.

```html
<script blocking="render" async src="async-script.js"></script>
```

Specifications
--------------

| Specification |
| --- |
| HTML Standard # the-script-element |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `document.currentScript`
* Flavio Copes' article on loading JavaScript efficiently and explaining the differences between `async` and `defer`
* JavaScript modules guide


<data>: The Data element - HTML: HyperText Markup Language

<data>: The Data element
========================

The **`<data>`** HTML element links a given piece of content with a machine-readable translation. If the content is time- or date-related, the `<time>` element must be used.

Try it
------

|  |  |
| --- | --- |
| Content categories | Flow content,
 phrasing content, palpable content.
  |
| Permitted content | Phrasing content. |
| Tag omission | None, both the starting and ending tag are mandatory. |
| Permitted parents |
 Any element that accepts
 phrasing content.
  |
| Implicit ARIA role | `generic` |
| Permitted ARIA roles | Any |
| DOM interface | `HTMLDataElement` |

Attributes
----------

This element's attributes include the global attributes.

`value`

This attribute specifies the machine-readable translation of the content of the element.

Examples
--------

The following example displays product names but also associates each name with a product number.

```html
<p>New Products</p>
<ul>
  <li><data value="398">Mini Ketchup</data></li>
  <li><data value="399">Jumbo Ketchup</data></li>
  <li><data value="400">Mega Jumbo Ketchup</data></li>
</ul>
```

### Result

Specifications
--------------

| Specification |
| --- |
| HTML Standard # the-data-element |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* The HTML `<time>` element.


<i>: The Idiomatic Text element - HTML: HyperText Markup Language

<i>: The Idiomatic Text element
===============================

The **`<i>`** HTML element represents a range of text that is set off from the normal text for some reason, such as idiomatic text, technical terms, taxonomical designations, among others. Historically, these have been presented using italicized type, which is the original source of the `<i>` naming of this element.

Try it
------

Attributes
----------

This element only includes the global attributes.

Usage notes
-----------

* Use the `<i>` element for text that is set off from the normal prose for readability reasons. This would be a range of text with different semantic meaning than the surrounding text. Among the use cases for the `<i>` element are spans of text representing a different quality or mode of text, such as:
    + Alternative voice or mood
    + Taxonomic designations (such as the genus and species "*Homo sapiens*")
    + Idiomatic terms from another language (such as "*et cetera*"); these should include the `lang` attribute to identify the language
    + Technical terms
    + Transliterations
    + Thoughts (such as "She wondered, *What is this writer talking about, anyway?*")
    + Ship or vessel names in Western writing systems (such as "They searched the docks for the *Empress of the Galaxy*, the ship to which they were assigned.")
* In earlier versions of the HTML specification, the `<i>` element was merely a presentational element used to display text in italics, much like the `<b>` element was used to display text in bold letters. This is no longer true, as these tags now define semantics rather than typographic appearance. A browser will typically still display the contents of the `<i>` element in italic type, but is, by definition, no longer required to do so. To display text in italic type, authors should use the CSS `font-style` property.
* Be sure the text in question is not actually more appropriately marked up with another element.
    + Use `<em>` to indicate stress emphasis.
    + Use `<strong>` to indicate importance, seriousness, or urgency.
    + Use `<mark>` to indicate relevance.
    + Use `<cite>` to mark up the name of a work, such as a book, play, or song.
    + Use `<dfn>` to mark up the defining instance of a term.
Examples
--------

This example demonstrates using the `<i>` element to mark text that is in another language.

```html
<p>
  The Latin phrase <i lang="la">Veni, vidi, vici</i> is often mentioned in
  music, art, and literature.
</p>
```

### Result

Technical summary
-----------------

|  |  |
| --- | --- |
| Content categories | Flow content,
 phrasing content, palpable content.
  |
| Permitted content | Phrasing content. |
| Tag omission | None, both the starting and ending tag are mandatory. |
| Permitted parents |
 Any element that accepts
 phrasing content.
  |
| Implicit ARIA role | `generic` |
| Permitted ARIA roles | Any |
| DOM interface | `HTMLElement` |

Specifications
--------------

| Specification |
| --- |
| HTML Standard # the-i-element |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `<em>`
* Other italicized elements: `<var>`, `<dfn>`, `<cite>`, `<address>`


<address>: The Contact Address element - HTML: HyperText Markup Language

<address>: The Contact Address element
======================================

The **`<address>`** HTML element indicates that the enclosed HTML provides contact information for a person or people, or for an organization.

Try it
------

The contact information provided by an `<address>` element's contents can take whatever form is appropriate for the context, and may include any type of contact information that is needed, such as a physical address, URL, email address, phone number, social media handle, geographic coordinates, and so forth. The `<address>` element should include the name of the person, people, or organization to which the contact information refers.

`<address>` can be used in a variety of contexts, such as providing a business's contact information in the page header, or indicating the author of an article by including an `<address>` element within the `<article>`.

Attributes
----------

This element only includes the global attributes.

Usage notes
-----------

* The `<address>` element can only be used to represent the contact information for its nearest `<article>` or `<body>` element ancestor.
* This element should not contain more information than the contact information, like a publication date (which belongs in a `<time>` element).
* Typically an `<address>` element can be placed inside the `<footer>` element of the current section, if any.
Examples
--------

This example demonstrates the use of `<address>` to demarcate the contact information for an article's author.

```html
<address>
  You can contact author at
  <a href="http://www.example.com/contact">www.example.com</a>.<br />
  If you see any bugs, please
  <a href="mailto:webmaster@example.com">contact webmaster</a>.<br />
  You may also want to visit us:<br />
  Mozilla Foundation<br />
  331 E Evelyn Ave<br />
  Mountain View, CA 94041<br />
  USA
</address>
```

### Result

Although it renders text with the same default styling as the `<i>` or `<em>` elements, it is more appropriate to use `<address>` when dealing with contact information, as it conveys additional semantic information.

Technical summary
-----------------

|  |  |
| --- | --- |
| Content categories | Flow content, palpable content. |
| Permitted content | Flow content, but with no nested `<address>` element, no heading
 content (`<hgroup>`, h1,
 h2, h3,
 h4, h5,
 h6), no sectioning content
 (`<article>`, `<aside>`,
 `<section>`, `<nav>`), and
 no `<header>` or `<footer>`
 element.
  |
| Tag omission | None, both the starting and ending tag are mandatory. |
| Permitted parents |
 Any element that accepts
 flow content, but always excluding `<address>` elements (according
 to the logical principle of symmetry, if
 `<address>` tag, as a parent, can not have nested
 `<address>` element, then the same
 `<address>` content can not have
 `<address>` tag as its parent).
  |
| Implicit ARIA role | `group` |
| Permitted ARIA roles | Any |
| DOM interface | `HTMLElement` Prior to Gecko 2.0 (Firefox 4),
 Gecko implemented this element using the
 `HTMLSpanElement` interface
  |

Specifications
--------------

| Specification |
| --- |
| HTML Standard # the-address-element |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* Others section-related elements: `<body>`, `<nav>`, `<article>`, `<aside>`, h1, h2, h3, h4, h5, h6, `<hgroup>`, `<footer>`, `<section>`, `<header>`;
* Sections and outlines of an HTML document.


<rt>: The Ruby Text element - HTML: HyperText Markup Language

<rt>: The Ruby Text element
===========================

The **`<rt>`** HTML element specifies the ruby text component of a ruby annotation, which is used to provide pronunciation, translation, or transliteration information for East Asian typography. The `<rt>` element must always be contained within a `<ruby>` element.

Try it
------

See the article about the `<ruby>` element for more examples.

Attributes
----------

This element only includes the global attributes.

Examples
--------

### Using ruby annotations

This simple example provides Romaji transliteration for the kanji characters within the `<ruby>` element:

```html
<ruby> 漢 <rt>Kan</rt> 字 <rt>ji</rt> </ruby>
```

```
body {
  font-size: 22px;
}
```

#### Result

Technical summary
-----------------

|  |  |
| --- | --- |
| Content categories | None. |
| Permitted content | Phrasing content. |
| Tag omission |
 The end tag may be omitted if the `<rt>` element is
 immediately followed by an `<rt>` or
 `<rp>` element, or if there is no more content in
 the parent element
  |
| Permitted parents | A `<ruby>` element. |
| Implicit ARIA role | No corresponding role |
| Permitted ARIA roles | Any |
| DOM interface | `HTMLElement` |

Specifications
--------------

| Specification |
| --- |
| HTML Standard # the-rt-element |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `<ruby>`
* `<rp>`
* `<rb>`
* `<rtc>`
* `text-transform: full-size-kana`


<meter>: The HTML Meter element - HTML: HyperText Markup Language

<meter>: The HTML Meter element
===============================

The **`<meter>`** HTML element represents either a scalar value within a known range or a fractional value.

Try it
------

|  |  |
| --- | --- |
| Content categories | Flow content,
 phrasing content, labelable content, palpable content.
  |
| Permitted content | Phrasing content, but there must be no `<meter>` element among its
 descendants.
  |
| Tag omission | None, both the starting and ending tag are mandatory. |
| Permitted parents |
 Any element that accepts
 phrasing content.
  |
| Implicit ARIA role | `meter` |
| Permitted ARIA roles | No `role` permitted |
| DOM interface | `HTMLMeterElement` |

Attributes
----------

This element includes the global attributes.

`value`

The current numeric value. This must be between the minimum and maximum values (`min` attribute and `max` attribute) if they are specified. If unspecified or malformed, the value is `0`. If specified, but not within the range given by the `min` attribute and `max` attribute, the value is equal to the nearest end of the range.

**Note:** Unless the `value` attribute is between `0` and `1` (inclusive), the `min` and `max` attributes should define the range so that the `value` attribute's value is within it.

`min`

The lower numeric bound of the measured range. This must be less than the maximum value (`max` attribute), if specified. If unspecified, the minimum value is `0`.

`max`

The upper numeric bound of the measured range. This must be greater than the minimum value (`min` attribute), if specified. If unspecified, the maximum value is `1`.

`low`

The upper numeric bound of the low end of the measured range. This must be greater than the minimum value (`min` attribute), and it also must be less than the high value and maximum value (`high` attribute and `max` attribute, respectively), if any are specified. If unspecified, or if less than the minimum value, the `low` value is equal to the minimum value.

`high`

The lower numeric bound of the high end of the measured range. This must be less than the maximum value (`max` attribute), and it also must be greater than the low value and minimum value (`low` attribute and `min` attribute, respectively), if any are specified. If unspecified, or if greater than the maximum value, the `high` value is equal to the maximum value.

`optimum`

This attribute indicates the optimal numeric value. It must be within the range (as defined by the `min` attribute and `max` attribute). When used with the `low` attribute and `high` attribute, it gives an indication where along the range is considered preferable. For example, if it is between the `min` attribute and the `low` attribute, then the lower range is considered preferred. The browser may color the meter's bar differently depending on whether the value is less than or equal to the optimum value.

`form`

This optional attribute is used to explicitly set a `<form>` owner for the `<meter>` element. If omitted, the `<meter>` is associated with its ancestor `<form>` element or the form association set by the `form` attribute on another ancestor element, such as on a `<fieldset>`, if any. If included, the value must be the `id` of a `<form>` in the same tree.

Examples
--------

### Simple example

#### HTML

```html
<p>
  Heat the oven to <meter min="200" max="500" value="350">350 degrees</meter>.
</p>
```

#### Result

On Google Chrome, the resulting meter looks like this:

![A screenshot of the meter element in Google Chrome](/en-US/docs/Web/HTML/Element/meter/screen_shot_2020-10-12_at_10.10.53_pm.png)

### High and Low range example

Note that in this example the `min` attribute is omitted. This is allowed, as it will default to `0`.

#### HTML

```html
<p>
  He got a <meter low="69" high="80" max="100" value="84">B</meter> on the exam.
</p>
```

#### Result

On Google Chrome, the resulting meter looks like this:

![red meter in Google Chrome](/en-US/docs/Web/HTML/Element/meter/screen_shot_2020-10-12_at_10.11.52_pm.png)

Specifications
--------------

| Specification |
| --- |
| HTML Standard # the-meter-element |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `<progress>`
* `::-webkit-meter-bar`, `::-webkit-meter-inner-element`, `::-webkit-meter-even-less-good-value`, `::-webkit-meter-optimum-value`, `::-webkit-meter-suboptimum-value`: non-standard pseudo-elements


<ruby>: The Ruby Annotation element - HTML: HyperText Markup Language

<ruby>: The Ruby Annotation element
===================================

The **`<ruby>`** HTML element represents small annotations that are rendered above, below, or next to base text, usually used for showing the pronunciation of East Asian characters. It can also be used for annotating other kinds of text, but this usage is less common.

The term *ruby* originated as a unit of measurement used by typesetters, representing the smallest size that text can be printed on newsprint while remaining legible.

Try it
------

|  |  |
| --- | --- |
| Content categories | Flow content,
 phrasing content, palpable content.
  |
| Permitted content | Phrasing content. |
| Tag omission | None, both the starting and ending tag are mandatory. |
| Permitted parents |
 Any element that accepts
 phrasing content.
  |
| Implicit ARIA role | No corresponding role |
| Permitted ARIA roles | Any |
| DOM interface | `HTMLElement` |

Attributes
----------

This element only includes the global attributes.

Examples
--------

### Example 1: Character

```html
<ruby>
  漢 <rp>(</rp><rt>Kan</rt><rp>)</rp> 字 <rp>(</rp><rt>ji</rt><rp>)</rp>
</ruby>
```

#### Result

### Example 2: Word

```html
<ruby> 明日 <rp>(</rp><rt>Ashita</rt><rp>)</rp> </ruby>
```

#### Result

Specifications
--------------

| Specification |
| --- |
| HTML Standard # the-ruby-element |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `<rt>`
* `<rp>`
* `<rb>`
* `<rtc>`
* `text-transform`: full-size-kana