W3cubDocs

/HTML

HTML attribute: content

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨July 2015⁩.

The content attribute specifies the value of a metadata name defined by the <meta> name attribute. It takes a string as its value, and the expected syntax varies depending on the name value used.

Value

The types of values that a content attribute accepts depends on the name value. For details on specific formats and types, see the <meta> name attribute page.

Examples

>

Setting a document meta description

The following <meta> tag uses name=description to set a "meta description" for a document. The content attribute provides the value for the metadata:

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

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS
content 1 12 1 ≤12.1 ≤4 18 4 ≤12.1 ≤3.2 1.0 4.4 ≤3.2

See also

  • <meta> name attribute

© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/content