HTML <head>Tag


Examples

An HTML document with a <title> tag in the head:

<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Document Title</title> </head> <body>Document content......</body> </html>

Try it Yourself »
(More examples at the bottom of the page)

Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

All major browsers support the <head> tag.


Tag Definition and Usage Instructions

The <head> element is a container for all head elements.

The <head> element must contain the document's title (title), and can include scripts, styles, meta information, and other additional information.

The following listed elements can be used inside the <head> element:


Differences between HTML 4.01 and HTML5

HTML5 no longer supports the profile attribute.


Attributes

Attribute Value Description
profile URL Not supported in HTML5.Specifies a set of rules for the document URL. These rules can be recognized by browsers and accurately read the information in the content attributes of the <meta> tag.


Global Attributes

The <head> tag supportsHTML Global Attributes。


Examples

Try it Yourself - Examples

Using the <base> tag in <head>
This example demonstrates how to use the <base> tag to specify a default URL and default target for all links on the page.

Using the <style> tag in <head>
This example demonstrates how to add style information in the <head> section.

Using the <link> tag in <head>
This example demonstrates how to use the <link> tag to link to an external style sheet.


Related Articles

HTML Tutorial:HTML Head

Other Extensions