head Element


 

Module

The head element is declared by the XHTML 1.1 Structure Module

Elements in the Structure Module are:
html | head | title | body

Description

The head element contains information about the document which is not to be displayed as part of its content. For example, the title element within the head contains a title for the document (this is not displayed on the page itself, but is usually available in the title bar of the window or tab containing the document and is often used by search engines or when a page is bookmarked). The link element can, amongst other things, be used to specify a style sheet to govern the page's presentation to the user, whether visually, aurally, for a printer, etc.

A valid XHTML 1.1 document must contain one and only one head element as the first child of the root html element. The head element must contain one and only one title element at any position within its children. It may also optionally contain one base element (but not more than one), again at any position within its children. Other possible children of the head element are meta, link, script, style and object, which may appear in any order and any number of times.

An example head element is shown below, which specifies the obligatory title and nothing else.

<head>
  <title>Page Title</title>
</head>

#REQUIRED Attributes

There are no #REQUIRED attributes on the head element.


Specific Attributes

Specific attributes of the head element are listed below:

From the Structure Module - the Element's own Module

profile [ type URIs ]
Meta data profile location

Common Attributes

Common attributes of the head element are listed below:

From the Core Attribute Collection

Note: Even though the *XHTML 1.1 Structure Module DTD specifies that the id attribute is permitted on the head element, the *W3C Markup Validator does not currently recognise this and a document which uses this attribute on the head element will fail validation. I have therefore omitted the id attribute on the head element in this reference.

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 head element is:

HeadOpts.mix*, ( ( base, HeadOpts.mix*, title, HeadOpts.mix* ) | ( title, HeadOpts.mix*, ( base, HeadOpts.mix* )? ) )

NOTE: This element cannot be empty

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

Valid children of head

Valid parents of head


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) > head Element