meta Element


 

Module

The meta element is declared by the XHTML 1.1 Metainformation Module

This is the only element in this Module.

Description

The meta element comes in two distinct guises, one where the name attribute is used and one where the http-equiv attribute is used.

Using the name Attribute

The name attribute can be used to define the name of a parameter which gives information about the document. The value of this parameter is then given in the content attribute. The scheme attribute is used if it is necessary to provide clarification as to the format of the data given in the content attribute and, if required, the xml:lang attribute can be used to specify the language of this data.

For example:

  1. <meta name="robots" content="index,follow" />
  2. <meta name="author" xml:lang="de" content="Jan Schmidt" />
  3. <meta name="modified" content="05-06-09" scheme="DD-MM-YY" />

There are no prescribed legal values for name, content or scheme attributes, but it is recommended (but not widely practised) to define the permitted values for name (along with expected content and any possible scheme interpretations) in a metadata profile, which is then specified in the profile attribute of the document's head element.

Using the http-equiv Attribute

Using the http-equiv attribute allows the meta element to mimic a particular HTTP header from within the document itself. It should be as though that particular HTTP header was sent by the server itself.

For example, the following code would mimic the header Content-Style-Type: text/css

<meta http-equiv="Content-Style-Type" content="text/css" />

This can be useful to specify information within a document which is not being served by a web server.

See also the X-UA-Compatible HTTP header.

#REQUIRED Attributes

The content attribute is #REQUIRED on the meta element.


Specific Attributes

Specific attributes of the meta element are listed below:

From the Metainformation Module - the Element's own Module

content [ type CDATA - #REQUIRED ]
Meta property value
http-equiv [ type NMTOKEN ]
May be used instead of the name attribute to state that the property value in the content attribute mimics the HTTP header specified in this attribute
name [ type NMTOKEN ]
Meta property name
scheme [ type CDATA ]
Meta data sheme used - helps correct interpretation of content

Common Attributes

Common attributes of the meta element are listed below:

From the Core Attribute Collection

xmlns [ type URI - #FIXED 'http://www.w3.org/1999/xhtml' ]
XML namespace

From the I18N Attribute Collection

dir [ type Enumeration (ltr | rtl) ], from the Bi-directional Text Module
Left-to-right or right-to-left directionality
xml:lang [ type LanguageCode ]
A language code for the element

Content Model

The Content Model for the meta element is:

EMPTY

See Content Model & Nesting for information about Content Model syntax and Nesting Groups.

Valid children of meta

This element is empty and may have no children.

Valid parents of meta


Page Footer & Copyright

Copyright © Sally Maughan 2005-2009 (Page last updated on 01 Oct 2009)

*Valid XHTML 1.1 - hosted by *Openstrike

Content based on the W3C Working Draft: *XHTML 1.1 and Recommendation: *XHTML Modularisation 1.1.

W3C, XHTML, XML, HTML, CSS and MathML are *Trademarks of the W3C (*MIT, *ERCIM, *Keio) with which the site's author has no connection.


Up, Next & Previous Links

Your Location

Home > XHTML 1.1 Home > XHTML 1.1 Indexes > Element Index (XHTML 1.1) > meta Element