HTML META Tags

Source: Internet
Author: User
Tags browser cache

Meta elements can provide meta-information about the page (meta-information), such as descriptions and keywords for search engines and update frequency.

The META tag is located at the head of the document and does not contain any content. The properties of the META tag define the name/value pairs associated with the document.

Properties of the <meta> tag:
HTTP-EQUIV: Associates the Content property to the HTTP header.
Name: Associate the Content property to a name.
Scheme: Defines the format used to translate content property values
Content: Defines meta information related to the HTTP-EQUIV or Name property.

Understanding name and content:
The meta name attribute describes what the current meta tag is, so that the search engine crawls and indexes the page. The corresponding content is to tell the search engine related information.
To make an analogy <meta name= "keywords" content= "meta"/> This line of code means: The keyword of this page is meta "
There are several common values for name
1, Keywords: keyword, that is, tell the search engine, the theme of this page is what. Example: <meta name= "Keywords" content= keyword, keyword 1, keyword 2, keyword 3,...,... "/>
Each keyword should be separated by a comma in English.
When several meta elements provide document language dependency information, search engines use the Lang feature to filter and display search results through the user's language precedence reference. For example:
<meta name= "Kyewords" lang= "EN" content= "Vacation,greece,sunshine" >
<meta name= "Kyewords" lang= "FR" content= "Vacances,grè:ce,soleil" >
2, Description: Introduction, that is to tell the search engine, the general content of this page. As if keywords is a mobile phone, description The general function of the phone, advantages and so on.
Example: <meta name= "Description" content= "This page tells the meta usage ..." >
3, Robots: Purely for the search engine to see, because keywords and description, human can also understand, and Robots non-professional people cannot understand.
When name is robots, the content optional parameter has
Index: The current page can be crawled
Follow: The page that is linked in the current page can be crawled
NOINDEX: The current page can not be crawled
Nofollow: The page that is linked in the current page cannot be crawled
Because content can be two-choice, such as content= "Index,follow", so the above four parameters, the total can be composed of 4 different double selection results.
which
<meta name= "Robots" content= "Index,follow"/> can be written <meta name= "Robots" content= "All"/>
<meta name= "Robots" content= "Noindex,nofollow"/> can be written <meta name= "Robots" content= "None"/>
4, Author: The author, that is to tell the search engine, the author of this page is who, the general kind of article nature of the page, this attribute is applied more.
Example <meta name= "Author" content= "Czbin,[email protected]" >
5, Copyrights: Copyright, tell the search engine, the copyright of this page belongs to whom.
Example: <meta name= "Copyrights" content= "Copyright Information" >
6, Generator: Production software, is the search engine even this also need to know? pages made with FrontPage and Dreamweaver, how do they crawl?
Example: <meta name= "Generator" content= "pcdata| Frontpage| " >
7, Revisit-after: Update time, that is, tell the search engine, this page how long will be updated, then, need to re-fetch example: <meta name= "Revisit-after" content= "2 Days" >

Understanding HTTP-EQUIV and Content:
Meta's Http-equiv property, which acts like an HTTP header protocol, tells the browser some information about character settings, page refreshes, cookies, and caches, among other things.
The commonly used HTTP-EQUIV values are as follows 11 kinds:
1:content-type: Declares the character set that the page applies to, as well as the page document properties. Example:
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
Tells the browser that the page is an HTML class document, and that gb2312 (Chinese) is applied as the default character.
2. Refresh: Set the time for page refresh or automatic jump
Example:
<meta http-equiv= "Refresh" content= ">"
Content= "60" means that after 60 seconds, the page refreshes
<meta http-equiv= "Refresh" content= "10; Url=http://www.isinwin.cn ">
Content= "10 means that after 10 seconds, the webpage will automatically jump.

3, Expires: Set the page expiration time, when the page expires, you must re-read the page information.
Example:
<meta http-equiv= "Expires" content= "Fri, June 01:13:13 GMT" >
<meta http-equiv= "Expires" content= "0" >
The time format must be GMT standard time, and content set to 0 means that the page will never expire.

4, Pragma: Prohibit browser cache page. Example:
<meta http-equiv= "Pragma" content= "No-cach" >
Prevent browser from caching pages (but viewers can also save pages)

5, Set-cookie: Set the expiration time of the Cookie. Example:
<meta http-equiv= "Set-cookie" content= "COOKIEVALUE=XXX; Expires=wednesday, 21-oct-98 16:14:21 GMT; path=/">
6. Window-target: Force the page to display on a separate page in the current window.
Example:
<meta http-equiv= "Widow-target" content= "_top" >
This property is used to prevent others from calling your page in the frame. Content options: _blank, _top, _self, _parent.

Differences between HTML 4.01 and HTML 5
In HTML 5, the scheme attribute is no longer supported.
In HTML 5, there is a new CharSet property that makes it easier to define a character set.
In HTML 4.01, you have to write this:
<meta http-equiv= "Content-type" content= "text/html; Charset=iso-8859-1 ">
In HTML 5, this is enough:
<meta charset= "Iso-8859-1" >

Reference:
Http://www.w3school.com.cn/tags/tag_meta.asp
http://blog.csdn.net/yixiaoqingyuz/article/details/4329975

Http://www.w3school.com.cn/html5/html5_meta.asp

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.