Content in the head tag in HTML

Source: Internet
Author: User
Definition and usage

<Head> A label defines the header of a document. It is a container for all header elements. The elements in

The document header describes the attributes and information of a document, including the document title, its location on the web, and its relationships with other documents. Most of the data contained in the document header is not actually displayed to the reader as the content.

The following labels are available in the head section:

<Base/> label "target =" _ blank "href =" http://www.w3school.com.cn/tags/tag_base.asp "> <base>,

Label "target =" _ blank "href =" http://www.w3school.com.cn/tags/tag_link.asp "> <link>,

<META/> tag "target =" _ blank "href =" http://www.w3school.com.cn/tags/tag_meta.asp "> <meta>,

<SCRIPT> tag "target =" _ blank "href =" http://www.w3school.com.cn/tags/tag_script.asp "> <SCRIPT>, <style>, and

<Title> tag "target =" _ blank "href =" http://www.w3school.com.cn/tags/tag_title.asp "> <title>.

<Title> defines the document title, which is the only required element in the head section.

 

 

HTML <base> label definition and usage

<Base> the tag specifies the default address or target for all links on the page.

Generally, the browser extracts the corresponding elements from the URL of the current document to fill in the blank space in the relative URL.

You can use the <base> label to change the value. The browser will no longer use the URL of the current document, but will use the specified basic URL to parse all relative URLs. These include the URLs in the <A>, , <link>, and <form> labels.

The target in <base> specifies how all links on the page are opened.

Instance
 
<Head><Base href = "http://www.w3school.com.cn/ I/"/><Base target = "_ blank"/></Head> <body>  <a href = "http://www.w3school.com.cn"> w3school </a> </body>

 

HTML <link> label definition and usage

<Link> the tag defines the relationship between the document and external resources.

<Link> the most common purpose of a tag is to link a style sheet.

Instance

Link an external style sheet:

<Head><LINK rel = "stylesheet" type = "text/CSS" href = "theme.css"/></Head>

 

HTML <meta> label definition and usage

<Meta> elements provide meta-information about pages, such as descriptions and keywords for search engines and update frequency.

<Meta> the tag is in the document header and does not contain any content. <Meta> the tag attribute defines the name/value pairs associated with the document.

This is what I want, for example.

First view attributes

Attribute Value Description DTD
HTTP-equiv
  • Content-Type
  • Expires
  • Refresh
  • Set-Cookie
Associate the content attribute with the HTTP header. STF
Name
  • Author
  • Description
  • Keywords
  • Generator
  • Revised
  • Others
Associate the content attribute with a name. STF
Scheme Some_text Defines the format used to translate the content property value. STF

 

Example:

1. Document Description

<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312"/>

<Meta name = "author" content = "w3school.com.cn">

<Meta name = "revised" content = "David yang, 8/1/07">
<Meta name = "generator" content = "Dreamweaver 8.0en">

2. Document keywords

 

<Meta name = "Description" content = "HTML Examples">

<Meta name = "keywords" content = "HTML, DHTML, CSS, XML, XHTML, JavaScript, VBScript">

3. Redirection

<Meta http-equiv = "refresh" content = "5; url = http://www.w3school.com.cn">

 

 

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.