Meta summary of html, introduction to the use of meta attributes in html tags

Meta summary of html, introduction to the use of meta attributes in html
tagsNovember 5, 2014 53757 views
Introduction
I have an introduction to meta in my previous blog, for example: http://www.haorooms.com/post/liulanq_think_ie Browse In this article, which comes to mind on server security, some attributes of IE under meta are introduced in the middle, which can realize transition between pages. It has been mentioned in SEO optimization. The following is a detailed introduction to the function and use of meta.

The preface
meta is an auxiliary tag in the head area of ​​the html language. Maybe you think these codes are optional. In fact, if you can make good use of meta tags, it will bring you unexpected results. The functions of meta tags are: search engine optimization (SEO), defining the language used by the page, automatically refreshing and pointing to a new page, and realizing the dynamics of web page conversion. Effects, control page buffering, web page rating and evaluation, control web page display window, etc.!
HTML meta summarizes
the composition of meta tags: meta tags have two attributes, they are http-equiv attribute and name attribute, different attributes have different parameter values, and these different parameter values ​​realize different web page functions.

1. The 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:

<meta name="parameter" content="specific parameter value">.
The name attribute mainly has the following parameters: 

A. Keywords (keywords) 

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

For example:

<meta name="keywords" content="meta summary, html meta, meta attribute, meta jump">
B. description (website content description)

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

For example:

<meta name="description"content="haorooms blog, meta summary of html, meta is an auxiliary tag in the head area of ​​html language.">
C, robots (robot wizard)

description: 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 are all, none, index, noindex, follow, nofollow. The default is all.

Example:

<meta name="robots"content="none">


















For example:

<meta name="author"content="root,[email protected]">
E, generator

<meta name="generator"content="information parameter"/>
The information parameter of the generator in the meta tag represents the description website What software is used to make.

F. COPYRIGHT

<META NAME="COPYRIGHT"CONTENT="information parameter">
The information parameter of COPYRIGHT in the meta tag represents the copyright information of the website.

G. revisit-after

<META name="revisit-after"CONTENT="7days">
revisit-after represents website revisit, 7days represents 7 days, and so on.

2. The 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 display the content of the web page correctly and accurately. The corresponding attribute value is content, The content in content is actually the variable value of each parameter.

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

<meta http-equiv="parameter" content="parameter variable value">
; The http-equiv attribute mainly has the following parameters:

A. Expires (expiration)

description: It 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:

<meta http-equiv="expires"content="Fri,12Jan200118:18:18GMT">
Note: GMT time format must be used.

B. Pragma (cache mode)

description: Forbid the browser to access the page content from the cache of the local computer.

Usage:

<meta http-equiv="Pragma"content="no-cache">
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:

<meta http-equiv="Refresh"content="2;URL=http://www.haorooms.com"> //(note the quotation marks behind, in front of the seconds and behind the URL)
Note: The 2 means that it will automatically refresh to the URL after staying for 2 seconds.

D. Set-Cookie (cookie setting)

description: If the webpage expires, the saved cookie will be deleted.

Usage:

<meta http-equiv="Set-Cookie" content="cookie value=xxx;expires=Friday,12-Jan-200118:18:18GMT;path=/">
Note: The time format of GMT must be used.

E. Window-target (setting of the display window)

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

usage:

<meta http-equiv="Window-target"content="_top">
Note: It is used to prevent others from calling their own pages in the frame.

F. Content-Type (setting of display character set)

Description: Set the character set used by the page.

Usage:

<meta http-equiv="content-Type"content="text/html;charset=gb2312">
The details are as follows:

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

When the information parameter of the charset of the meta tag is BIG5, it means that the code used by the website is traditional Chinese; when the information parameter of the charset of the meta tag

is such as iso-2022-jp, it means that the code used by the website is Japanese;

When the information parameter of charset is ks_c_5601, it means that the code used by the website is Korean;

when the information parameter of charset of meta tag is ISO-8859-1, it means that the code used by the website is English;

the information parameter of charset of meta tag For example, when UTF-8, it represents the universal language code;

G, content-Language (display language setting)

usage:

<meta http-equiv="Content-Language" content="zh-cn"/>


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

only-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 buffer area.

Private indicates that the whole or part of the response message for a single user cannot be processed by the shared cache. This allows the server to describe only when a user's partial response message is invalid for other users' requests. The

no-cache indicates that the request or response message cannot be cached

. The no-store is used to prevent important information from being inadvertently published. Sending in the request message will make the request and response messages not use the cache.

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 responses with a response time less than the current time plus the specified time

max-stale indicates that the client can receive more than Response message during timeout. If you specify a value for max-stale messages, the client can receive response messages that exceed the value specified in the timeout period.

J. http-equiv="imagetoolbar"

<meta http-equiv="imagetoolbar"content="false"/>


K. Content-Script-Type

<Meta http-equiv="Content-Script-Type"Content="text/javascript">
W3C webpage specification, indicating the type of script in the page.

L page jump, only for IE,

please see http://www.haorooms.com/post/liulanq_think_ie

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326646342&siteId=291194637