Home > Web Front-end > HTML Tutorial > Introduction to the use of the http-equiv attribute in the meta tag_HTML/Xhtml_Web page production

Introduction to the use of the http-equiv attribute in the meta tag_HTML/Xhtml_Web page production

WBOY
Release: 2016-05-16 16:40:38
Original
1331 people have browsed it

meta is an auxiliary tag in the head area of ​​html language. Maybe you think this code is dispensable. In fact, if you can make good use of meta tags, it will bring you unexpected effects. The functions of meta tags are: search engine optimization (SEO), defining the language used on the page, automatically refreshing and pointing to new pages, and realizing dynamics during web page conversion. Effect, control page buffering, web page rating and evaluation, control the window for web page display, etc.!

Composition of meta tag: The meta tag has two attributes, they are http-equiv attribute and name attribute. Different attributes have different parameter values. These different parameter values Different web page functions are implemented.

1. Name attribute

The name attribute is mainly used to describe web pages, and the corresponding attribute value is content. The content in content is mainly used by search engine robots to find information and classify information. . The syntax format of the name attribute of the

meta tag is:

.

The name attribute mainly has the following parameters:

A. Keywords (keywords)

Explanation: keywords are used to tell search engines what the keywords of your web page are. .

Example:

B. description (website content description)

Explanation: description is used to tell search engines the main content of your website.

Example:

C. robots (robot guide)

Explanation: robots are used to tell search robots which pages need to be indexed and which pages do not need to be indexed.

The parameters of content include all, none, index, noindex, follow, and nofollow. The default is all.

Example:

D. author (author)

Explanation: Mark the author of the web page

Example:

2. http-equiv attribute

http-equiv, as the name suggests, is equivalent to the file header function of http. It can return some useful information to the browser to help correct and accurate The content of the web page is displayed accurately, and the corresponding attribute value is content. The content in content is actually the variable value of each parameter. The http-equiv attribute syntax format of

meta tag is:

;

The http-equiv attribute mainly has the following parameters:

A. Expires

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

Usage:

Note: GMT time format must be used.

B. Pragma (cache mode)

Description: Prohibit the browser from accessing page content from the cache of the local computer.

Usage:

Note: With this setting, visitors will not be able to browse offline.

C. Refresh (refresh)

Description: Automatically refresh and point to the new page.

Usage: (note the quotation marks at the end, respectively before the seconds and after the URL)

Note: The 2 means that it will automatically refresh to the URL after staying for 2 seconds. URL.

D. Set-Cookie (cookie setting)

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

Usage:

Note: GMT time format must be used.

E. Window-target (display window setting)

Description: Force the page to be displayed as an independent page in the current window.

Usage:

Note: Used to prevent others from calling your own page in the frame.

F, content-Type (display character set setting)

Description: Set the character set used by the page.

Usage:

G, content-Language (display language setting)

Usage:

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

ly-if-cached, and the instructions in the response message include public, private, no -cache, no-store, no-transform, must-revalidate, proxy-revalidate, max-age. The meaning of the instructions in each message is as follows
Public indicates that the response can be cached by any cache
Private indicates that all or part of the response message for a single user cannot be processed by the shared cache. This allows the server to only describe a partial response message from a user that is not valid for other users' requests
no-cache indicates that the request or response message cannot be cached
no-store is used to prevent important information from being inadvertently released . Sending it in the request message will cause both the request and response messages to use caching.
max-age indicates that the client can receive responses with a lifetime no greater than the specified time in seconds
min-fresh indicates that the client can receive responses with a response time less than the current time plus the specified time
max-stale indicates that the client can receive response messages beyond the timeout period. If you specify a value for max-stale messages, the client can receive response messages that exceed the specified value of the timeout period.

Meta tag usage tips:

Meta tag is a language used to describe the properties of web pages. Standard Meta tags can facilitate search engine ranking and improve search engine websites. Weight ranking. If you want your website to be more in line with search engine standards, you must understand meta tags. Below, Seoer will explain the meaning and usage of meta tags:

1. Keywords of META tags

The writing method is:

The information parameter of the Keywords of the meat tag represents the keywords of the website.

2. Description of the META tag



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

3. The http-equiv=Content-Typecontent="text/html of the META tag

http-equiv=Content-Type represents the HTTP header protocol and prompts the browser for the web page Information,



When the information parameter of the charset of the meta tag is such as GB2312, it means that the encoding used by the website is Simplified Chinese;

The charset of the meta tag When the information parameter is like BIG5, it means that the encoding used by the website is Traditional Chinese; When the information parameter of the charset of the

meta tag is like iso-2022-jp, it means that the encoding used by the website is Japanese;

When the charset information parameter of the meta tag is such as ks_c_5601, it means that the encoding used by the website is Korean;

When the charset information parameter of the meta tag is such as ISO-8859-1, it means that the website is The encoding used is English;

When the information parameter of the charset of the meta tag is UTF-8, it represents the world's universal language encoding;

4. The generator of the META tag



The information parameters of the generator of the meta tag represent the software used to create the website.

5. The author of the META tag



The author information parameter of the meta tag represents the copyright author information of the web page

6. http-equiv="Refresh" of the META tag



The Refresh of the meta tag represents how long it takes for the web page to automatically refresh. Adding the URL parameters in Url means how long it takes to automatically link to other URLs.

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

means that the browser is prohibited from accessing page content from the cache of the local computer. With this setting, visitors will not be able to browse offline.

8. META. COPYRIGHT of the tag



The COPYRIGHT information parameter of the meta tag represents the website copyright information.

9. http-equiv="imagetoolbar" of the META tag.



Specify whether to display the image toolbar. When false, it means not to display, when true, it means to display.

10. Content-Script- of the META tag. Type



W3C web page specification, indicating the type of script in the page.

11. META tag revisit-after



revisit-after represents website revisit, 7days represents 7 days, and so on.

12. Robots of META tags

Robots representatives tell search engine robots which pages to crawl

The attributes are described as follows :

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

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

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

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

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

information parameter is nofollow: the file will be retrieved, but the links on the page cannot be queried;

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template