Copyright © tutorialspoint.com

HTML <meta> tag



Advertisements

Function:

The HTML <meta> tag is used for declaring metadata for the HTML document.

Difference between HTML and XHTML:

In HTML the <meta> tag has no end tag.

In XHTML the <meta> tag must be properly closed.

Example:

<html>
<head>
<title>HTML meta tag</title>
<meta name="keywords" content="HTML, meta tag, metadata" />
<meta name="description" content="Brief description of the document" />
<meta http-equiv="refresh" content="10" />
</head>
<body style="background-color:orange">
Document content goes here
</body>
</html>

For more detail on Meta Tag please go through Meta Tag

Attributes:

AttributeValueDescription
Nameauthor
description
keywords
generator
revised
others
Name for the property.
contenttextDefines meta information to be associated with http-equiv or name.
http-equivcontent-type
expires
refresh
set-cookie
Connects the content attribute to an HTTP header.
schemetextDefines a format to be used to interpret the value of the content attribute.

Standard Attributes:

AttributeDescription
dirSpecifies the direction of the text
langSets the language code.
xml:langSets the language code.

Copyright © tutorialspoint.com