HTML <meta> instructions using

Source: Internet
Author: User

Www.w3school.com Description:

HTML <meta> Tag Browser support
IE Firefox Chrome Safari Opera

All browsers support <meta> tags.

Definition and usage

The <meta> element provides meta-information about the page (meta-information), such as descriptions and keywords for search engines and update frequency.

The <meta> tag is located in the header of the document and does not contain any content. The properties of the <meta> tag define the name/value pairs associated with the document.

The difference between HTML and XHTML

The,<meta> tag does not have an end tag in HTML.

In XHTML, the,<meta> tag must be properly closed.

Tips and Comments:

Note The:<meta> tag is always inside the head element.

Note: Metadata is always passed in pairs in the form of a name/value.

Required Properties
Properties value Description
Content
  • Some_text
Define meta information related to the HTTP-EQUIV or Name property
Optional properties
Properties value Description
Http-equiv
  • Content-type
  • Expires
  • Refresh
  • Set-cookie
Associate the Content property to the HTTP header.
Name
  • Author
  • Description
  • Keywords
  • Generator
  • Revised
  • Others
Associate the Content property to a name.
Scheme Some_text Defines the format used to translate content property values.
Name property

The Name property provides the names in the name/value pairs. Neither HTML nor XHTML tags specify any pre-defined <meta> names. Typically, you are free to use a meaningful name for yourself and the reader of your source document.

"keywords" is a name that is often used. It defines a set of keywords for a document. Some search engines use these keywords to categorize documents when they encounter these keywords.

A meta tag like this might be helpful for entering the index of a search engine:

name="keywords"Content= "Html,asp,php,sql" >

If the Name property is not provided, then the names in the name/value pairs take the value of the Http-equiv property.

Http-equiv Property

The Http-equiv property provides a name for a name/value pair. and instructs the server to include a name/value pair in the header of the MIME document to be routed to the browser before sending the actual document.

When the server sends a document to the browser, many name/value pairs are sent first. Although some servers send many of these name/value pairs, all servers must send at least one: content-type:text/html. This tells the browser to be ready to accept an HTML document.

When using the <meta> tag with the Http-equiv property, the server adds a name/value pair to the header of the content sent to the browser. For example, add:

http-equiv="charset"http-equiv="expires"Content= "from Dec" >

The head that is sent to the browser should contain:

Content-type:text/htmlcharset:iso-8859-1expires:31 DEC 2008

Of course, these fields make sense only if the browser can accept these additional header fields and use them in the appropriate way.

Content Properties

The Content property provides the value in a name/value pair. The value can be any valid string.

The content property is always used with the Name property or the Http-equiv property.

Scheme attribute

The scheme attribute is used to specify the scheme to be used to translate attribute values. This scenario should be defined in the profiles file specified by the profile property of the

The following is a reference to the contents of http://www.cnblogs.com/lovesong/p/5745893.html

Meta-detailed

Meta tags can be divided into two parts: http-equiv and name variables.

Http-equiv

HTTP-EQUIV corresponds to the file header of HTTP, which can send back useful information to the browser to help the browser display the content of the page correctly.

Value Describe Example
Content-type Set the character set used by the page
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 ">
GB2312, the representative of the website is the use of the code is Simplified Chinese, iso-8859-1, the representative description of the website is the use of the code is English, UTF-8, representing the world-wide language encoding; PS:HTML5 page is done directly using <meta charset= " Utf-8 "/>
X-ua-compatible IE8 's special tag, used to specify the IE8 browser to simulate the rendering of a particular version of IE, to resolve some compatibility issues.
<meta http-equiv= "x-ua-compatible" content= "ie=7" >  
The above code tells IE that the IE8/9 will render the page with the IE7 engine, whether or not the document standard is declared with a DTD.
<meta http-equiv= "x-ua-compatible" content= "ie=8" >  
The above code tells IE Browser, IE8/9 will be IE8 engine to render the page.
<meta http-equiv= "x-ua-compatible" content= "Ie=edge" >  
The above code tells IE Browser, IE8/9 and later version will be the highest version of IE to render the page.
<meta http-equiv= "x-ua-compatible" content= "ie=edge,chrome=1" >
The above code Ie=edge tells IE to use the latest Engine rendering Web page, chrome=1 can activate Chrome frame.ps: Google add a plugin: Google Chrome frame (Google embedded browser framework GCF), This plugin can keep the user's IE browser intact, but when users are browsing the web, they are actually using the Google Chrome kernel, and support IE6, 7, 8 and many other versions of IE browser.
Expires Sets the expiration time of the Web page.
<meta http-equiv= "Expires" content= "FRI,12JAN200118:18:18GMT" >
PS: The time format of GMT must be used
Refresh Automatically refreshes and points to the new page.
<meta http-equiv= "Refresh" content= "2; Url=https://www.baidu.com ">
Ps:2 on behalf of the page after 2 seconds to jump to the back of the URL
Set-cookie If the page expires, the local cookie is automatically deleted.
<meta http-equiv= "Set-cookie" content= "Cookie value=xxx;expires=friday,12-jan-200118:18:18gmt;path=/" >
PS: The time format of GMT must be used.
Windows-target Force the page to be displayed as a separate page in the current window, preventing your page from being called by others as a frame page
<meta http-equiv= "Window-target" content= "_top" >
Cache-control Caching mechanism
<meta http-equiv= "Cache-control" content= "No-cache" >
Public: Indicates that the response can be cached by any buffer. Private: Indicates that the entire or partial response message for a single user cannot be shared with the cache. This allows the server to simply describe a partial response message for the user, and this response message is not valid for another user's request. No-cache: Indicates that the request or response message cannot be cached. No-store: Used to prevent important information from being inadvertently released. Sending in the request message will make the request and response messages do not use the cache. Max-age: Indicates that the client can receive a response that has a lifetime of not greater than the specified time (in seconds). Min-fresh: Indicates that the client can receive a response time that is less than the current time plus the specified time. Max-stale: Indicates that the client can receive a response message that exceeds the timeout period. If you specify a value for the Max-stale message, the client can receive a response message that exceeds the specified value for the timeout period.

Name

The name attribute is mainly used to describe the Web page, and its corresponding property value is content,content content is mainly convenient for search engine robot to find information and classification information.

Value Describe Example
Author The author of the callout page
<meta name= "Author" content= "Dashen"/>
Keywords Page keywords, used by search engine included
<meta name= "keywords" content= "news, news Center, news channel" >
Description Page description, for search engine inclusion
<meta name= "description" content= "News center, including political news, domestic news, international news, social news, current affairs commentary, news Pictures, news topics, News forum, Military, history, professional Affairs report Portal" >
Viewport Used to control page scaling

Maximum-scale=1, minimum-scale=1, User-scalable=no ">
Details can be viewed at: http://www.cnblogs.com/lovesong/p/4355029.html
Renderer Specifies how the dual-core browser renders the page by default.
<meta name= "renderer" content= "WebKit" >//default WebKit kernel <meta name= "renderer" content= "Ie-comp" >//default IE Compatibility mode <meta name= "renderer" content= "Ie-stand" >//default IE Standard mode
ps:360 Browser Support
Generator Describe what software is used to make the website
<meta name= "generator" content= "Microsoft"/>
Revised Modification time of Web document
<meta name= "Revised" content= "design net, 6/24/2015"/>
Robots Used to tell the search robot which pages need to be indexed, and which pages do not need indexes.
<meta name= "Robots" content= "None"/>
Value: All|none|index|noindex|follow|nofollow, default Allall: The file will be retrieved, and the link on the page can be queried; none: The file will not be retrieved and the link on the page cannot be queried; index: The file will be retrieved Follow: The link on the page can be queried; NOINDEX: The file will not be retrieved, but the link on the page can be queried; nofollow: The file will not be retrieved and the link on the page can be queried.
Copyright Website Copyright Information
<meta name= "Copyright" content= "This page copyright xxx all. All rights Reserved "/>

HTML <meta> instructions using

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.