HTML Head element mainly contains metadata (data about data) about the HTML Page.

You can place the HTML page title, scripts, styles, and other meta information in the head element. This information is helpful for search engines as well as provides additional data for HTML page.

Type of data in HTML Head element:

  • Title: HTML Head element contains title of the page that is displayed in browser title bar.
  • Scripts: All client-side scripts such as JavaScript often included in this Head section
  • Styles: Internal & External Style rules also included inside Head element
  • Meta: There are few meta tags such as description & keywords about HTML pages are included inside the head section. These are useful for Search Engines.

The above data placed in the head is never directly visible in the main browser window. Some of the head metadata is helpful for search engines like Google for better document understanding. While styles are used to extend page formatting. Scripts are internally used to enhance HTML web pages functionality & event handling.

Example of HTML Head Element data

<!DOCTYPE html>
<title> HTML Head Tutorial - </title>
<meta charset="UTF-8">
<meta name="description" content="This website provides free online tutorials">
<meta name="keywords" content="HTML, CSS, PHP, SEO">
<meta name="author" content="">
<link rel="stylesheet" type="text/css" href="style.css">
<script type="text/javascript">
alert("Simple JavaScript Alert");
This is sample content.

You can see following example, where different kind of meta-information included in the Head element.

When you run above example, you can see same title in Browser title bar as defined in title tag in head. Meta keywords, description & author information is used by search engines.

You can read in detail about styles & scripts in later chapters.

Congratulations! Chapter Finished. Learn more about the similar topics:
Exercises & Assignments
No Content Found.
Interview Questions & Answers
No Content Found.