Go to main content
Bypass navigation bar HTML Reference HTML Tags HTML Tutorials
Bypass language selection
Bypass location bar

Location: Home > HTML Reference > HTML Tags > HTML meta tag

Bypass main content

HTML meta tag

Note: If you don't know what an element/tag is and/or how you must use it we recommend you to read our HTML tags and attributes tutorial that you can find in our HTML tutorials section.

Bypass main content

Description

The HTML meta element allows authors to insert custom varibales or properties for HTML documents. These variables are composed by two values: the name of the property and its value. Aditionally, you can include other information that may improve the comprehension of its purpose.

The HTML meta element must be included in the head section of the document and can contain information like: author, keywords, descriptions, dates, expiration dates, codes, identifiers, ISBN numbers, etc.

Examples

<html>
<head>
<title>Car rental in New York</title>
<meta name="Author" content="Jhon Doe" />
<meta name="keywords" lang="en" content="car, rental, rent" />
<meta name="keywords" lang="es" content="autos, alquiler, alquila" />
<meta name="description" lang="en" content="Car rental in New York. Cheap prices best insurance. Call now 999-NO-NUMBER." />
<meta http-equiv="expires" content="Mon, 20 Sep 2006 11:09:00 GMT" />
</head>
<body>
Contents...
</body>
</html>

Attributes

lang (langcode)

Specifies the language of an element's content. The default value in "unknown".

When writing XHTML 1.0 documents, the attribute used to specify the language of an elements is "xml:lang". For forward and backward compatibility both attributes can be used simultaneously like in the example below. Note, that in XHTML 1.1 the "lang" attribute has been completely replaced by "xml:lang" and its use is no longer valid.

<p lang="en" xml:lang="en">This is a paragraph in english.</p>
<p lang="es" xml:lang="es">Este es un párrafo en español.</p>

dir

This attribute indicates the direction in which the texts of the element must be read. This includes content, attribute values and tables. It has two possible values that are case-insensitive:

  • RTL: Right to left.
  • LTR: Left to right.
<q lang="he" dir="rtl">...an Hebrew quotation...</q>

name (name)

This attribute assigns a property name.

<meta name="Author" content="Jhon Doe" />

content (cdata)

This attribute assigns a value to the property.

<meta name="Author" content="Jhon Doe" />

http-equiv (name)

This attribute can be used to replace the "name" attribute. HTTP servers use information in this type of meta elements to send header information as response when a page is requested.

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

scheme (cdata)

This attribute provides user agents with aditional information to correctly interpret the property.

<meta scheme="ISBN" name="identifier" content="143512975X" />
<meta scheme="Month-Day-Year" name="date" content="03-21-2011" />

Events

This element doesn't support any event.

See a complete list and information about events in HTML

Diseño y desarrollo: Latitud29.com

Links and logos|Contact|Beyond HTML|Tools and resources|Sitemap|Webmaster|Donate