html5 Site Icon CSS3 Site Icon CSS Site Icon

HTML4 Reference

HTML <head> tag

Definition

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.

Example


<html  xmlns="http://www.w3.org/1999/xhtml">
Everything goes between the start and end HTML tags. 

<head>
  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="http://htmldoctor.info/" />
  <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>
</head>

<body>
  The content of the web page appears in the body section.
</body>

We complete the HTML file with the closing HTML tag.
</html>

Required Attributes

NONE

Optional Attributes

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


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

Common Attributes

NONE

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

NONE



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

go to home page Homepage go to top of page Top

HTML Elements

The complete set of HTML elements also known as HTML tags from the latest HTML 4.01 Specification.

Click the links for more information on individual tags and their attributes.

<!--...-->

<!DOCTYPE>

<a>

<abbr>

<acronym>

<address>

<applet>

<area />

<b>

<base />

<basefont />

<bdo>

<big>

<blockquote>

<body>

<br />

<button>

<caption>

<center>

<cite>

<code>

<col />

<colgroup>

<dd>

<del>

<dfn>

<dir>

<div>

<dl>

<dt>

<em>

<fieldset>

<font>

<form>

<frame />

<frameset>

<h1> - <h6>

<head>

<hr />

<html>

<i>

<iframe>

<img />

<input />

<ins>

<isindex />

<kbd>

<label>

<legend>

<li>

<link />

<map>

<menu>

<meta />

<noframes>

<noscript>

<object>

<ol>

<optgroup>

<option>

<p>

<param />

<pre>

<q>

<s>

<samp>

<script>

<select>

<small>

<span>

<strike>

<strong>

<style>

<sub>

<sup>

<table>

<tbody>

<td>

<textarea>

<tfoot>

<th>

<thead>

<title>

<tr>

<tt>

<u>

<ul>

<var>