HTML / HTML Attributes

HTML Content Attribute

Dec 12, 2022
1 min read
HTML content Attribute

Definition

The content attribute specifies the name for the http-equiv or name attribute, depending on which is used.

Applicable Elements

The content Attribute can be used with the following elements:

HTML <meta> content Attribute

The <meta> tag specifies metadata, or information, about a HTML document that cannot otherwise be expressed using the <title>, <base>, <link>, <style>, or <script> tags.

The content attribute specifies the name for the http-equiv or name attribute, depending on which is used.

Syntax

<meta name="viewport" content="width=device-width" />

Usage

  • The content attribute holds the value for either the http-equiv or name attribute. See those attributes for usage requirements.

Examples

Below are two examples of the content attribute. One is pairing it with an http-equiv attribute, the other with a name attribute.

<meta name="generator" content="Hugo 0.80.0" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">

Specification

The content HTML specification for the <meta> element is as follows:

Browser Support

The content has the following browser support:

Desktop

ChromeEdgeFirefoxIEOperaSafari
<meta>YesYesYesYesYesYes

Mobile

Android WebviewChrome AndroidFirefox AndroidOpera AndroidiOS SafariSamsung Internet
<meta>YesYesYesYesYesYes