Introduction to the use of HTTP-EQUIV properties in meta tags

Source: Internet
Author: User
Tags character set current time generator min

Meta is an auxiliary label for the HTML language Head area. Maybe you think the code is optional. In fact, if you can use a good meta tag, will give you an unexpected effect, meta tags are: Search engine optimization (SEO), the definition of the use of the language page, automatic refresh and point to the new page, the implementation of the Web page conversion dynamic effect, control page buffering, page rating evaluation, control of the page display window, etc.

Meta tag composition: Meta tags have two properties, they are the Http-equiv property and the Name property, different attributes have different parameter values, these different parameter values to achieve different Web page features.

1, Name property

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

The name attribute syntax format for the META tag is:

<metaname= "parameter" content= "specific parameter value" >.

The Name property has the following main parameters:

A, Keywords (keywords)

Description: Keywords is used to tell search engines what the keywords are on your page.

For example: <metaname= "keywords" content= "science,education,culture,politics,ecnomics,relationships,entertaiment, Human ">

B, description (Website content description)

Description: Description used to tell the search engine your site's main content.

For example: <metaname= "description" content= "Thispageisaboutthemeaningofscience,education,culture." >

C, Robots (Robot Guide)

Description: Robots are used to tell search bots which pages need to be indexed and which pages do not need to be indexed.

The parameters of the content are all,none,index,noindex,follow,nofollow. The default is all.

Example: <metaname= "content=" "None" >

D, author (author)

Description: The author of the callout page

Example: <metaname= "author" content= "root,root@xxxx.com" >

2, Http-equiv Property

Http-equiv as the name implies, the equivalent of HTTP file header, it can send back some useful information to the browser to help correct and accurate display of Web page content, and the corresponding property value of the content,content is actually the variable value of each parameter.

The HTTP-EQUIV attribute syntax format for meta tags is:

<metahttp-equiv= "content= parameter variable value" >;

The HTTP-EQUIV attribute has the following main parameters:

A, Expires (term)

Description: Can be used to set the expiration time of a Web page. Once the page expires, it must be retransmitted to the server.

Usage: <metahttp-equiv= "expires" content= "FRI,12JAN200118:18:18GMT" >

Note: The time format for GMT must be used.

B, Pragma (cache mode)

Description: Prevents browsers from accessing page content from the local computer's cache.

Usage: <metahttp-equiv= "Pragma" content= "No-cache" >

Note: This setting makes it impossible for visitors to browse offline.

C, refresh (refreshing)

Description: Automatically refreshes and points to the new page.

Usage: <metahttp-equiv= "Refresh" content= "2; Url=http://www.jb51.net "> (note the following quotes, in front of the seconds and behind the URL)

Note: 2 of which is to stop for 2 seconds after the automatic refresh to the URL URLs.

D, Set-cookie (Cookie set)

Note: If the page expires, the saved cookie will be deleted.

Usage: <metahttp-equiv= "Set-cookie" content= "cookievalue=xxx;expires=friday,12-jan-200118:18:18gmt;path=/" >

Note: The time format for GMT must be used.

E, Window-target (display window settings)

Description: Forces the page to appear as a separate page in the current window.

Usage: <metahttp-equiv= "window-target" content= "_top" >

Note: Used to prevent others from calling their own pages in the frame.

F, Content-type (display set of character set)

Description: Set the character set used by the page.

Usage: <metahttp-equiv= "content-type" content= "text/html;charset=gb2312" >

G, Content-language (Display language Settings)

Usage: <metahttp-equiv= "content-language" content= "ZH-CN"/>

H, Cache-control Specifies the caching mechanism that the request and response follow.
CACHE-CONTROL Specifies the caching mechanism that the request and response follow. Setting Cache-control in a request message or in a response message does not modify the caching process during another message handling process. Cached instructions at request include No-cache, No-store, Max-age, Max-stale, Min-fresh, on

Ly-if-cached, the instructions in the response message include public, private, No-cache, No-store, No-transform, Must-revalidate, Proxy-revalidate, Max-age. The instructions in each message have the following meanings
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 handled by the shared cache. This allows the server to simply describe a partial response message from a user that is not valid for another user's request
No-cache indicates that a request or response message cannot be cached
No-store is used to prevent important information from being inadvertently released. Sending in a request message will not use caching for both request and response messages.
Max-age indicates that the client can receive a response that is not longer than the specified time (in seconds)
Min-fresh indicates that the client can receive response times that are less than the current time plus a specified time
Max-stale indicates that the client can receive response messages that exceed 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.

Meta tag usage tips:

Meta tag is a language used to describe the properties of a Web page, the standard meta tags can be easily sorted by search engines to improve the ranking of Search engine Web site weights. If you want to make the site more in line with the search engine standards must understand the META tags, the following from the seoer to talk about the meaning of meta tags and how to use:

1. Meta tag keywords

The wording is: <metaname= "Keywords" content= "Information parameter"/>

Meat tags Keywords information parameters that represent what the site's keywords are.

2. Meta tag description

<metaname= "Description" content= "Information parameters"/>

Meta tags are description information parameters that represent the main content of the site, and what the profile is.

3, Meta tags http-equiv=content-typecontent= "text/html

Http-equiv=content-type represents the HTTP header protocol, which prompts the browser Web page for information,

<metahttp-equiv= "Content-type" content= "text/html;charset= Information parameters"/>

Meta tags charset information parameters such as GB2312 when the representative describes the site is the use of the code is Simplified Chinese;

Meta tags charset information parameters such as BIG5 when the representative describes the site is the use of the code is traditional Chinese;

Meta tags charset information parameters such as ISO-2022-JP when the representative describes the site is used in the code is Japanese;

Meta tags charset information parameters such as ks_c_5601 when the representative describes the site is the use of the code is Korean;

Meta tags charset information parameters such as iso-8859-1 when the representative describes the site is used in the code is English;

Meta tags charset information parameters such as UTF-8, representing the world's common language encoding;

4. Meta tag Generator

<metaname= "Generator" content= "Information parameters"/>

Meta tag Generator information parameters that represent what software is used to make the site.

5. Meta Tag author

<metaname= "Author" content= "Information parameters" >

Meta tag's author information parameter that represents the copyright author information for the page.

6, the META tag http-equiv= "Refresh"

<metahttp-equiv= "Refresh" content= "time;" Url= URL parameter ">

The META tag's refresh represents how much time the page automatically refreshes, plus the URL parameter on behalf of how long to automatically link to other URLs.

7, Meta tags http-equiv= "Pragma" content= "No-cache"

<metahttp-equiv= "Pragma" content= "No-cache" > prohibits browsers from accessing the contents of the page from the local computer's cache, so that visitors will not be able to browse offline.

8, the META tag of the copyright

<metaname= "COPYRIGHT" content= "Information parameters" >

Meta tags The information parameters of the copyright, representing the site copyright information.

9, Meta tags of the http-equiv= "Imagetoolbar"

<metahttp-equiv= "Imagetoolbar" content= "false"/>

Specifies whether the Picture toolbar is displayed, and when False is not displayed, the display is represented by true.

10. Meta Tag Content-script-type

<metahttp-equiv= "Content-script-type" content= "Text/javascript" >

The Web page specification that indicates the type of script in the page.

11. Meta Tag Revisit-after

<metaname= "Revisit-after" content= "7days" >

Revisit-after on behalf of the website, 7days represents 7 days, and so on.

12, Meta tags robots<metaname= "contect=" "Information parameters" >

Robot representatives tell search engine what pages to crawl

The properties are described below:

The information parameter is all: The file will be retrieved and the link on the page can be queried;

The information parameter is none: The file will not be retrieved and the link on the page cannot be queried;

The information parameter is index: The file will be retrieved;

The information parameter is follow: the link on the page can be queried;

The information parameter is NOINDEX: The file will not be retrieved, but the link on the page can be queried;

The information parameter is nofollow: The file will be retrieved, but the link on the page can not be queried;

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.