XHTML » Tags » head

<head> ... </head>

The head tag is the HTML document header. It serves as a container for other tags that control the contents and appearance of the main body of the document.

A well-formed XHTML document must contain properly nested and closed html, head, title, and body tags. The head tag is inserted immediately after the html tag, but before the body or frameset tags.
The head element can contain any of the following HTML tags in any order:

Tag Description
base set base URL
link set document link
meta document keywords
script script code
style set style sheet rules
title name of document

The separate closing tag is mandatory.


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<title>DevGuru XHTML head Tag Example</title>
<base href="http://www.devguru.com/" />
<link rel="stylesheet" type="text/css" href="include/StylesDefinitions.css" />
Language(s): XHTML

See Also: