Head elements
<title>
…</title>
Define a document title. This element is required in every HTML and XHTML document. Different user agents may make use of the title
in different ways. Web browsers usually display it in the title bar when the window is open, and in the task bar when it is minimized. It may become the default filename when saving the page, Search engines' web crawlers may pay particular attention to the words used in the title
element. The title
element must not contain any nested tags (in other words it cannot contain any other elements). Only one title
element is permitted in a document.
<base/>
Specifies a base URL for all relative href
and other links in the document. Must appear before any element that refers to an external resource. HTML permits only one base
element for each document. The base
element has attributes, but no contents.
<link/>
Specifies links to other documents, such as 'previous' and 'next' links, or alternate versions. An HTML head
may contain any number of link
elements. The link
element has attributes, but no contents. A common use is to link to external stylesheets, using the form:
<link rel="stylesheet" type="text/css" href="url" title="description of style" />
(deprecated)
Specifies a base font size, typeface and color of the document. Used together with font
elements. Deprecated in favor of stylesheets.
<script>
…</script>
Used to add JavaScript or other scripts to the document. The script code may be literally typed between the script
tags and/or it may be in a separate resource whose URL is specified in script
's optional src
attribute.
<style>
…</style>
Specifies a style for the document, usually:
<style type="text/css">…</style>
The CSS statements may be literally typed between the style
tags and/or it may be in separate resources whose URLs are specified in @import
directives such as:
<style> @import "url"; </style>
.
<object>
…</object>
Use for including generic objects within the head
. Though rarely used as a head
element, this could potentially be used to extract foreign data, relevant to the document, and associate this data with the current document.
<meta/>
Can be used to specify author, publication date, expiry date, page description, keywords and any other metadata not provided through the other head
elements and attributes. Because of their generic nature, meta
elements specify key-value pairs.
In one form, meta
elements can specify HTTP headers which should be sent before the actual content when the HTML page is served from web server to client. For example:
<meta http-equiv="foo" content="bar" />
This example specifies that the page should be served with an HTTP header called 'foo' that has a value 'bar'
In the general form, a meta
element specifies name
and associated content
attributes describing aspects of the HTML page. To prevent possible ambiguity, a third optional scheme
attribute may be supplied to specify a semantic framework that defines the meaning of the key and its value. For example
<meta name="foo" content="bar" scheme="DC" />
In this example, the meta
element identifies itself as containing the 'foo' element, with a value of 'bar', from the DC or Dublin Core resource description framework.