HTML head tag and element

1. HTML head element contains metadata which represents information about the HTML document.

2. It also includes links to the scripts and style sheets.


<head>other metadata elements </head> 


HTML head element is part of the global structure of an HTML page.

Whether both start and end tags are required

Both start and end tags are optional.

Can contain

HTML head element can contain only following elements - base, link, meta, script, style, and title.

Can reside within

HTML head element can reside within html element only.


Attributes specific to this element

profile - Value of the profile attribute is a URL. The URL points to a document that contains a set of rules. User agents can read those rules to understand the information contained within the meta tags.


Does not support.

language information and text direction

lang, dir.


Does not support.


Does not support.


HTML html element does not support event attributes.

Example of using HTML head element

Bellow is a simple HTML page which is containing metadata, title, and link within its head element. The head element also contains a profile attribute.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<head profile="https://www.w3resource.com/profiles.html" >
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>html head tag example</title>
<link rel='stylesheet' href='test.css' type='text/css'>
<p>We are learning HTML head element. </p>


html head element

View this example in a separate browser window

HTML head tag example.

Pictorial presentation


Previous: DOCTYPE HTML 4.01 tutorial
Next: HTML head tag and element

Test your Programming skills with w3resource's quiz.

Follow us on Facebook and Twitter for latest update.

We are closing our Disqus commenting system for some maintenanace issues. You may write to us at reach[at]yahoo[dot]com or visit us at Facebook