HTML Head
The head element contains general information, also called meta-information, about a document.
Meta means “information about.”
You can say that meta-data means information about data, or meta-information means information about information.
Information inside the Head Element
The elements inside the head element should not be displayed by a browser.
Only a few tags are legal inside the head section.
These are: <base>, <link>, <meta>, <title>, <style>, and <script>.
Check the illegal construct on the right:
|
|
<head>
<p>This is some text</p>
</head>
|
|
In this case the browser has two options:
- Display the text because it is inside a paragraph element.
- Hide the text because it is inside a head element.
If you put an HTML element like <h1> or <p> inside a head element like this, most browsers will display it, even if it is illegal.
Head Tags
| Tag |
Description |
<head> |
Defines information about the document. |
<title> |
Defines the document title. |
<base> |
Defines a base URL for all the links on a page. |
<link> |
Defines a resource reference. |
<meta> |
Defines meta information. |
| Tag |
Description |
<!DOCTYPE> |
Defines the document type. This tag goes before the <html> start tag. |
Demonstration
The following demonstration shows how the HTML script is displayed on the Web.