You are here: >

HTML head

html headIn an HTML file, the html head is the first section in the code that contains information about a web page's properties and links to external related files. For example, in the HTML head you can have the title of the page, meta tags, CSS code, Open Graph tags, and JavaScript code.

Tip: The head section is denoted by an opening <head> tag and ended at the closing </head> tag.

HTML with head example

The following example is a basic HTML page template that helps demonstrate where the head section of the code is placed when creating a web page. As can be seen below the head section and its contents are in bold.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta content="Example page demonstrating the head section" name="description">
<title>Example page</title>


If you need to add a line or code into the HTML head section it must be placed between the <head> and </head> tags. Typically, new lines are added in the line above the </head> tag.

Also see: Code, Internet terms, Programming terms