Advertisement
❮ Previous: <h1> to <h6> Next: <header> ❯

<head>

HTML <head> (Document Head) Tag

Example

<!DOCTYPE html>
<html>
<head>
  <title>Title of the document</title>
</head>
<body>

<h1>Heading  of the document</h1>
<p>Paragraph  of the document.</p>

</body>
</html>

Try this code ❯

Meaning

The <head> element specifies the document head, which contains descriptive information about the HTML document as well as other supplementary information, such as styl, meta data, links and scripts.

The <head> element contains:

<title> (required in every HTML document)

<style>

<base>

<link>

<meta>

<script>

<noscript>

Version: HTML 2, 3.2, 4, 4.01, 5


Standard Syntax

<head>
  <title>, <link>, <meta>, <style>, <script>, <base>  
</head>


Advertisement

Attributes

Attribute Value Description
profile URL Specifies the URIs of one or more metadata profiles, separated by white space

Global Attributes

<head> element also supports the Global Attributes in HTML.


More Examples

<style> tag inside the <head> element

Example

<!DOCTYPE html>
<html>
<head>
<style>
  h1 {color: red;}
  p { color: tomato;}
</style>
</head>
<body>

<h1>Heading  of the document</h1>
<p>Paragraph  of the document.</p>

</body>
</html>

Try this code ❯


By Default CSS Value(s)

Most of the browsers will display the <head> element with the following by default value(s)

head {
  display: none;
}
❮ Previous: <h1> to <h6> Next: <header> ❯
Advertisement