View video tutorial

HTML content Attribute

HTML

The HTML content attribute is primarily used within the <meta> tag to provide a value for information defined by the name or http-equiv attribute.

Definition and Usage


➔ The content attribute is necessary to specify metadata about an HTML document.

➔ When used with the name attribute, the content attribute provides information such as keywords, description, or authorship.

➔ When used with the http-equiv attribute, the content attribute provides a value such as refresh, content-type.

Syntax
//When used with the name attribute.
Description:
<meta name="description" content="A description of the content of web page.">

Keywords:
<meta name="keywords" content="HTML, CSS, JavaScript">

Author:
<meta name="author" content="John Doe">.

//When used with the http-equiv attribute.
Refresh:
<meta http-equiv="refresh" content="30">

Content-Type:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

Applies to

This attribute can be used on the following element.

Attribute Element
content <meta>