Instance
-
- Title of the document
-
Header
-
information inside the header element is not displayed in the browser window.
-
<HTML><Head><Metahttp-equiv= "Content-type"content= "text/html; charset=gb2312" /><Metahttp-equiv= "Content-language"content= "ZH-CN" /><title>Title does not appear in the document area</title></Head><Body><P>This text will be displayed.</P></Body></HTML>
View results:
-
- A target, all the links
-
-
This example shows how to use the base tag to make all the labels in a page open in a new window.
-
<HTML><Head><Metahttp-equiv= "Content-type"content= "text/html; charset=gb2312" /><Metahttp-equiv= "Content-language"content= "ZH-CN" /><BaseTarget= "_blank"></Head><Body><P><ahref=".. /index.htm "Tppabs= "http://www.w3school.com.cn/"Target= "_blank">This connection</a>will be loaded in a new window because the target property is set to "_blank". </P><P><ahref=".. /index.htm "Tppabs= "http://www.w3school.com.cn/">This connection</a>will also be loaded in a new window, even without the target property. </P></Body></HTML>
View results:
Head element
The header element contains summary information about the document, also known as meta Information (meta-information). Meta means "information about a particular aspect".
As you can say, metadata (meta-data) is information about the data, and meta-information is information about it.
Information inside the header element
Elements within the header element are not displayed by the browser.
According to the HTML standard, only a few tags are valid in the header part of the HTML. They are: <base>, <link>, <meta>, <title>, <style> and <script>.
This is an illegal structure:
< Head > < P > This is some text</p></head>
In this case, the browser has two options:
- Displays the text as it is in the paragraph element.
- Hides the text as it is in the header element.
If you put HTML elements such as
is the browser really supposed to ignore this error? We don't think so. Even if others think so.
Head tag
label |
Description |
|
Defines information about the document. |
<title> |
Defines the document title. |
<base> |
Defines the base URL for all links in the page. |
<link> |
Defines a resource reference. |
<meta> |
Defines meta information. |
label |
Description |
<! Doctype> |
Defines the document type. This tag must precede the HTML tag. |