What is HTML <head> tag ?
HTML <head> tag defines header section of HTML document.
HTML <head> tag is the first tag inside an <html> tag.
In HTML 4.01 the <head> element was mandatory but in HTML5, the <head> element can be omitted.
How HTML <head> tag works ?
HTML <head> tag acts as a container for metadata (data about data) and is placed between the <html> tag and the <body> tag.
Metadata is data about the HTML document. Metadata is not displayed.
Metadata defines the document title, character set, styles, scripts, and other meta information.
Why HTML <head> tag is used ?
HTML <head> tag is used to define the metadata of the HTML document for example document title, character set, styles, scripts, and other meta information.
HTML <head> tag is used for indicating the head section of the HTML document.
And whatever tags included inside head tags are not displayed on browser window.
The following tags/elements can be included inside the <head> tag listed below,
1. <title> (required in every HTML document)
2. <style>
3. <base>
4. <link>
5. <meta>
6. <script>
7. <noscript>
HTML beginners tutorial !!!
Click to Learn More about – HTML Tutorial for beginners
Syntax :
<head>
<title>Title of the document</title>
</head>
Example :
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>My new test webpage</title>
</head>
<body>
<p>This is my new webpage</p>
</body>
</html>
Output :

<head> Tag Attributes
HTML <head> tag support following specific attributes.
Sno | Attributes | Value | Description |
---|---|---|---|
1 | profile | url | Specify one or more meta data profiles URL separated by white space. |
Global Attributes
HTML <head> tag does not support any global attributes.
Event Attributes
HTML <head> tag does not support any event attributes.
Browser Compatibility
Sno | Browser | Support |
1 | Chrome | Yes |
2 | Firefox | Yes |
3 | Edge | Yes |
4 | Opera | Yes |
5 | Safari | Yes |
6 | Internet Explorer | Yes |