Basic Structure

HTML <head> Tag

The <head> element is a container for metadata (data about data) and is placed between the <html> tag and the <body> tag.

Definition and Usage

The <head> element is a container for metadata (data about data) and is placed between the <html> tag and the <body> tag.

Standard Syntax:<head>...</head>

Interactive ExampleRunnable

HTML <head> Example

html
Try it Yourself
Live code demonstration for the <head> tag. Click "Try it Yourself" to edit and experiment in real time.
<!DOCTYPE html>
<html lang="en">

 <head>

  
 <title>Title of the document</title>

 </head>
<body>

<h1>This is a heading</h1>
<p>This is a 
    paragraph.</p>

</body>
</html>

Attributes for <head>

0 Supported Attributes

The <head> tag does not have tag-specific attributes. It supports all standard Global Attributes.

Global Attributes

The <head> tag also supports the standard global attributes in HTML, including class, id, style, title, hidden, and data-*.

HTML Global Attributes Reference →
Event Attributes

The <head> tag supports event attributes in HTML, such as onclick, onmouseover, onfocus, and more.

HTML Event Attributes Reference →

Browser Compatibility

ChromeEdgeFirefoxSafariOpera

More Tags in Basic Structure

View All 123Tags →