HTML <head> tag
Example
A simple HTML document, with the minimum of required tags:
<html>
<head>
<title>Title of the document</title>
</head>
<body>
The content of the document......
</body>
</html>
|
(more examples at the bottom of this page) |
Definition and Usage
The 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!
Browser Support

The <head> tag is supported in all major browsers.
Differences Between HTML and XHTML
NONE
Optional Attributes
DTD indicates in which DTD the attribute is allowed. S=Strict, T=Transitional, and F=Frameset.
| Attribute |
Value |
Description |
DTD |
| 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 Attributes
The <head> tag supports the following standard attributes:
| Attribute |
Value |
Description |
DTD |
| dir |
rtl
ltr |
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 |
More information about Standard Attributes.
Event Attributes
The <head> tag does not support any event attributes.
More information about Event Attributes.
 |
Try it Yourself - Examples |
Use of the <base> tag in <head>
How to use the <base> tag to specify a default URL and a default target for all links on a page.
Use of the <style> tag in <head>
How to add style information to the <head> section.
Use of the <link> tag in <head>
How to use the <link> tag to link to an external style sheet.
Use of <meta> tags in <head>
How to use <meta> tags to describe the document.
Reliable, Affordable, Feature-Rich Web Hosting!
Take the uncertainty out of Web hosting and let
GoDaddy.com put service, performance and value back in. No matter which
hosting type or plan you choose, your site receives 24/7
maintenance and protection in our world-class data center. Plus,
you get the expert, friendly service you deserve, from the
world's largest hostname provider.
With three plans to choose from and
prices starting at just $4.99 per month, GoDaddy.com is sure to have a plan that's
right-sized and right-priced just for you!
All plans feature FREE 24x7 setup, FREE 24x7 monitoring, best-
of-breed routers, firewalls and servers, 24x7 onsite physical security
and access to our exclusive Go Daddy Hosting Connection, THE place
to install over 30 FREE applications. Virtual Dedicated and Dedicated
Server plans also available.
Visit GoDaddy.com today.
Virtual Dedicated, Dedicated Server and unlimited plans also available.
Save 20% on 12 months or more of shared web hosting - Enter code w3s20off at checkout
|