HTML4 Reference

HTML <head> tag


The <head> tag denotes the document head element of a HTML document.

The <head> tag must come directly after the <html> opening tag and its closing </head> tag must precede the <body> opening tag.

The <head> element can contain the following tags:

<base />, <link />, <meta />, <script>, <style> and <title>.

The <title> tag is the only required tag of the <head> element.


<html  xmlns="">
Everything goes between the start and end HTML tags. 

  The header contains meta information pertaining to the HTML document as well 
  as a mandatory title tag. External files such as CSS stylesheets and JavaScript
  files are also imported in the header section of our HTML file.
  <title>A Title which will appear in the Windows title bar.</title>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <base href="" />
  <link href="../../global.css" rel="stylesheet" type="text/css" />
  <script src="../../js/jquery.js" type="text/javascript">Javascript in here</script>
  <script type="text/javascript">Javascript in here</script>
  <style type="text/css">CSS in here</style>

  The content of the web page appears in the body section.

We complete the HTML file with the closing HTML tag.

Required Attributes


Optional Attributes

profile - specifies the URL location(s) of a meta data profile.

<head profile="aURL"></head>

Common Attributes


Language Attributes

dir - specifies the directional flow of the content.

<head dir="ltr"></head>   <!-- The text will flow from left to right -->
<head dir="rtl"></head>   <!-- The text will flow from right to left -->

lang - specifies a language code for the content of the element.

<head lang="en">Some text here</head>

xml:lang - specifies a language code for the content of the element in XHTML documents.

<head xml:lang="fr">Some text here</head>

Event Attributes


<h1> - <h6> tags    << Prev          Next >>  <hr /> tag

go to home page Homepage go to top of page Top