ExampleA simple HTML document, with the minimum of required tags:
<title>Title of the document</title>
The content of the document......
Try it yourself »
(more examples at the bottom of this page)
Definition and UsageThe head element is a container for all the head elements. Elements inside <head> can include scripts, instruct the browser where to find style sheets, provide meta information, and more.
The following tags can be added to the head section: <base>, <link>, <meta>, <script>, <style>, and <title>.
The <title> tag defines the title of the document, and is the only required element in the head section!
The <head> tag is supported in all major browsers.
Differences Between HTML and XHTMLNONE
Optional AttributesDTD indicates in which HTML 4.01/XHTML 1.0 DTD the attribute is allowed. S=Strict, T=Transitional, and F=Frameset.
|profile||URL||Specifies a URL to a document that contains a set of rules. The rules can be read by browsers to clearly understand the information in the <meta> tag's content attribute||STF|
Standard AttributesThe <head> tag supports the following standard attributes:
|Specifies the text direction for the content in an element||STF|
|lang||language_code||Specifies a language code for the content in an element||STF|
|xml:lang||language_code||Specifies a language code for the content in an element, in XHTML documents||STF|
Event AttributesThe <head> tag does not support any event attributes.
More information about Event Attributes.