Introduction to the http-equiv attribute in meta Tags, metahttp-equiv

Source: Internet
Author: User

Introduction to the http-equiv attribute in meta Tags, metahttp-equiv
Introduction to the http-equiv attribute in meta Tags

Meta is an auxiliary tag in the head area of the html language. Maybe you think the code is dispensable. In fact, if you can make good use of the meta tag, it will bring you unexpected results. The meta tag has the following functions: Search Engine Optimization (SEO), defining the language of the page, automatically refresh and refer to the new page to achieve the dynamic effect of page conversion, control page buffering, page Rating Evaluation, control page display windows, etc!

Meta tag Composition: Meta tags have two attributes: http-equiv and name. different attributes have different parameter values, these different parameter values enable different webpage functions.

1. name attribute

The name attribute is mainly used to describe the webpage, and the corresponding attribute value is content. The content in the content is mainly used to facilitate search engine robots to find information and classify information.

The syntax format of the name attribute of the meta tag is:

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

The name attribute has the following parameters:

A. Keywords)

Note: keywords are used to tell the search engine what keywords are on your webpage.

Example: <metaname = "keywords" content = "science, education, culture, politics, ecnomics, relationships, entertaiment, human">

B. description (website content description)

Description: description is used to tell the search engine the main content of your website.

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

C. robots (robot wizard)

Note: robots is used to tell robots which pages need to be indexed and which pages do not need to be indexed.

Content parameters include all, none, index, noindex, follow, and nofollow. The default value is all.

Example: <metaname = "robots" content = "none">

D. author (author)

Note: the author of the webpage

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

2. http-equiv attributes 

Http-equiv, as its name implies, is equivalent to an http File Header. It can return some useful information to the browser to help display the webpage content correctly and accurately. The corresponding attribute value is content, content is actually the variable value of each parameter.

The syntax of the http-equiv attribute of the meta tag is as follows:

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

The http-equiv attribute has the following parameters:

A. Expires (TERM)

Note: You can set the expiration time of a webpage. Once the webpage expires, it must be re-transmitted to the server.

Usage: <metahttp-equiv = "expires" content = "Fri, 12Jan200118: 18: 18GMT">

Note: The GMT time format must be used.

B. Pragma (cache Mode)

Note: The browser is prohibited from accessing the page content from the cache of the local computer.

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

Note: in this way, visitors will not be able to browse offline.

C. Refresh (Refresh)

Note: automatically refresh and point to the new page.

Usage: <metahttp-equiv = "Refresh" content = "2; URL = http://www.jb51.net">)

Note: 2 means that the URL is automatically refreshed after 2 seconds.

D. Set-Cookie (cookie setting)

Note: If the webpage expires, the cookie on the disk will be deleted.

Usage: <metahttp-equiv = "Set-Cookie" content = "cookievalue = xxx; expires = Friday, 12-Jan-200118: 18: 18GMT; path =/">

Note: The GMT time format must be used.

E. Window-target (display Window settings)

Note: The Force page is displayed on an independent page in the current window.

Usage: <metahttp-equiv = "Window-target" content = "_ top">

Note: It is used to prevent others from calling their own pages in the framework.

F. content-Type (display character set setting)

Description: sets the character set used on the page.

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

G. content-Language (set the Display Language)

Usage: <metahttp-equiv = "Content-Language" content = "zh-cn"/>

H. Cache-Control specifies the Cache mechanism for requests and responses.
Cache-Control specifies the Cache mechanism that requests and responses follow. Setting Cache-Control in a request message or response message does not modify the Cache processing process of another message. Request cache Commands include no-cache, no-store, max-age, max-stale, min-fresh, on

Ly-if-cached: commands in the Response Message include public, private, no-cache, no-store, no-transform, must-revalidate, proxy-revalidate, and max-age. The instructions in each message are as follows:
Public indicates that the response can be cached in any cache area.
Private indicates that the whole or part of the response message of a single user cannot be processed by the shared cache. This allows the server to describe only part of the user's response message, which is invalid for requests of other users.
No-cache indicates that the request or response message cannot be cached.
No-store is used to prevent the unintentional release of important information. Sending a request message does not cache the request and response messages.
Max-age indicates that the client can receive responses with a lifetime not greater than the specified time (in seconds ).
Min-fresh indicates that the client can receive a response whose response time is earlier than the current time plus the specified time
Max-stale indicates that the client can receive response messages beyond the timeout period. If the value of the max-stale message is specified, the client can receive response messages that exceed the timeout period.

Meta tag usage tips:

Meta Tags are a language used to describe web page attributes. standard Meta tags can be used to facilitate search engine sorting and improve the ranking of Search Engine weights. To better comply with the search engine standards, you must understand the meta tag. The following describes the meaning and usage of the meta tag by Seoer:

1. keywords of the META tag

Written as: <metaname = "Keywords" content = "information parameter"/>

The Keywords parameter of the meat tag indicates the keyword of the website.

2. Description of the META tag

<Metaname = "Description" content = "Information Parameters"/>

The Description parameter of the meta tag indicates the main content and overview of the website.

3. http-equiv = Content-Typecontent = "text/html

Http-equiv = Content-Type indicates the HTTP header protocol, prompting the browser webpage information,

<Metahttp-equiv = "Content-Type" content = "text/html; charset = information parameter"/>

If the charset Information Parameter of the meta tag is GB2312, it indicates that the website uses simplified Chinese characters;

When the charset Information Parameter of the meta tag is BIG5, it indicates that the website is encoded in Traditional Chinese;

Meta tag charset information parameters such as iso-2022-jp, indicating that the website is encoded in Japanese;

If the charset Information Parameter of the meta tag is ks_c_5601, it indicates that the website is encoded in Korean;

Meta tag charset information parameters such as ISO-8859-1, indicating that the website is encoded in English;

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

4. generator of META tag

<Metaname = "generator" content = "Information Parameters"/>

The information parameter of the generator of the meta tag indicates the software used by the website.

5. author of META tags

<Metaname = "author" content = "information parameter">

The author parameter of the meta tag, indicating the author information of the webpage copyright.

6. META tag http-equiv = "Refresh"

<Metahttp-equiv = "Refresh" Content = "time; Url = Url parameter">

The Refresh of the meta tag indicates the time when the webpage is automatically refreshed, And the Url parameter is added to indicate the time when other URLs are automatically linked.

7. HTTP-EQUIV of META tag = "Pragma" CONTENT = "no-cache"

<METAHTTP-EQUIV = "Pragma" CONTENT = "no-cache"> This means that the browser is prohibited from accessing the page CONTENT from the cache of the Local Computer, so that visitors will not be able to browse offline.

8. COPYRIGHT of the META tag

<METANAME = "COPYRIGHT" CONTENT = "information parameter">

The COPYRIGHT parameter of the meta tag, indicating the website COPYRIGHT information.

9. META tag http-equiv = "imagetoolbar"

<Metahttp-equiv = "imagetoolbar" content = "false"/>

Specifies whether to display the image toolbar. If it is set to false, the image is not displayed. If it is set to true, the image is displayed.

10. Content-Script-Type of the META tag

<Metahttp-equiv = "Content-Script-Type" Content = "text/javascript">

W3C Web page specification, indicating the script type on the page.

11. revisit-after for META tags

<METAname = "revisit-after" CONTENT = "7 days">

Revisit-after indicates that the website is revisited, and 7 days indicates 7 days.

12. Robots <metaname = "Robots" contect = "Information Parameters">

Robots representatives tell search engine Robots what pages to capture

The attributes are described as follows::

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 cannot be queried;

Related Article

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.