CSS Portal

HTML <head> Tag

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong!

Description

The <head> element is a fundamental part of an HTML document that serves as a container for metadata and other information about the document that isn’t displayed directly on the web page. It sits at the top of the HTML structure, immediately following the <!DOCTYPE html> declaration and the opening <html> tag, and precedes the <body> tag, which contains the visible content.

The <head> tag plays a crucial role in defining the document’s overall configuration and behavior. It can include a variety of elements such as the document’s title (<title>), links to external resources like stylesheets (<link>), scripts (<script>), character encoding declarations (<meta charset>), viewport settings for responsive design (<meta name="viewport">), and other metadata that provides information to browsers, search engines, and social media platforms.

Although the content within the <head> is not rendered on the page itself, it influences how the page behaves, appears, and interacts with external services. For example, the <head> determines the page title shown in the browser tab, sets up custom fonts or styles via CSS, loads JavaScript functionality, and provides instructions for search engine indexing or social media sharing previews.

In essence, the <head> is the backstage control room of an HTML document, organizing and linking all the resources and settings necessary for the web page to function correctly and appear as intended, even though users do not see it directly.

Properties

Permitted Parents
An <html> element, as its first child.
Content
<title> (required), <link>, <meta>, <style>, <script>, <base>, <object>
Start/End Tags
Start tag: optional, End tag: optional

Example

<html>
<head>
<title>Title of the document</title>
</head>
<body>
The content of the document goes here
</body>
</html>

Attributes

None

Global Attributes

The <head> tag also supports the Global Attributes in HTML5

Event Attributes

The <head> tag also supports the Event Attributes in HTML5

Browser Support

The following information will show you the current browser support for the HTML <head> tag. Hover over a browser icon to see the version that first introduced support for this HTML tag.

This tag is supported by all modern browsers.
Desktop
Chrome
Edge
Firefox
Opera
Safari
Tablets & Mobile
Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-

Last updated by CSSPortal on: 26th December 2025

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong!