HTML Advanced Programming (5)--html head

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.