O'Reilly logo

HTML & XHTML: The Definitive Guide, 5th Edition by Chuck Musciano, Bill Kennedy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The Document Header

The document header describes the various properties of the document, including its title, position within the Web, and relationship with other documents. Most of the data contained within the document header is never actually rendered as content visible to the user.

The <head> Tag

The <head> tag serves to encapsulate other header tags. Place it at the beginning of your document, just after the <html> tag and before the <body> or <frameset> tag. Both the <head> tag and its corresponding ending </head> tag can be unambiguously inferred by the browser and so can be safely omitted from an HTML, but not an XHTML, document. We encourage you to include them in all your documents, since they promote readability and support document automation.

The <head> tag may contain a number of other tags that help define and manage the document’s content. These include, in any order of appearance: <base>, <isindex>, <link>, <meta>, <nextid>, <object>, <script>, <style>, and <title>.

The dir and lang attributes

As we discussed in the sections about the <html> tag attributes, dir and lang help extend HTML and XHTML to an international audience. [Section 3.6.1.1] [Section 3.6.1.2]

The profile attribute

Often, the header of a document contains a number of <meta> tags used to convey additional information about the document to the browser. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required