The HTML content attribute
Quick answer
The HTML content attribute provides the value for a meta tag's name or http-equiv declaration. It is used on the <meta> element.
Overview
The content attribute holds the value of a meta declaration. It is used on document head elements like <meta>, <link> and <script>.
It belongs to the document head — metadata, stylesheet and script loading, encoding and resource hints. These attributes shape how the page is interpreted and how efficiently its resources load.
Syntax
<meta name="description" content="A short page summary for search engines.">
Values
| Value |
|---|
A string whose meaning depends on the accompanying name/http-equiv. |
Best practices
- Declare the character encoding with <meta charset="utf-8"> first in the <head>.
- Load scripts with defer (or as modules) so they do not block parsing.
- Protect third-party resources with integrity and crossorigin (Subresource Integrity).
- Use resource hints like preload deliberately, paired with the right as value.
Frequently asked questions
What does the content attribute do?
Holds the value of a meta declaration.