CSS Portal

HTML content Attribute

☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee
content
HTML AttributeThis attribute is supported by all modern browsers.
Updated 28th March 2024

Description

The content attribute in HTML is used in conjunction with the <meta> tag, providing important metadata about the web page. This attribute plays a crucial role in defining the page's character set, description, keywords, author of the document, and more. Its value is a string that represents the information or value assigned to the element specified by the name or http-equiv attributes in the same <meta> tag.

For instance, when the name attribute is set to "description," the content attribute contains a brief summary of the page's content. This summary can influence how search engines understand and display the page in search results. Similarly, when the name attribute is set to "keywords," the content attribute lists keywords relevant to the page, which used to help search engines in indexing, though its importance has diminished over time.

Additionally, the content attribute can specify the document's character encoding when used with <meta charset="">. This ensures that the browser correctly displays the text on the webpage, especially when non-English characters are involved.

The correct usage of the content attribute enhances SEO (Search Engine Optimization), accessibility, and the overall user experience by ensuring that browsers and search engines accurately interpret and represent the page's content.

Syntax

<meta name="value" content="text">

Values

  • textAn alphanumeric string value.

Applies To

Example

&lt;meta name="description" content="This is a description of the webpage content."&gt;
Open in editor

Browser Support

The following information will show you the current browser support for the HTML content attribute. Hover over a browser icon to see the version that first introduced support for this HTML attribute.

This attribute is supported by all modern browsers.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported
☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee