Meta-usage in HTML

Source: Internet
Author: User
Tags set time sorts

Meta is an accessible tag in the head area of the HTML language. In almost all pages, we can see HTML code similar to the following:
  

http-equiv="content-Type" content="text/html; charset=gb2312">  </head>

Maybe you think the code is dispensable. In fact, if you can use good meta tags, will bring you unexpected results, such as keywords will be automatically collected by large search sites automatically, you can set the page format and refresh and so on.

I. Composition of META tags

Meta tags have a total of two properties, which are the http-equiv property and the name property, and different properties have different parameter values, these different parameter values to achieve a different page function.
  

1. Name property

The name attribute is mainly used to describe the Web page, and its corresponding property value is content,content content is mainly convenient for search engine robot to find information and classification information.
The META tag's Name property has the syntax format: Where the name attribute mainly has the following parameters:

A, Keywords (keywords)

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

B, description (Website content description)

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

C, Robots (Robot Wizard)

Description: Robots is used to tell the search robot which pages need to be indexed and which pages do not.
The content parameters are all,none,index,noindex,follow,nofollow. The default is all.
Example:

D, author (author)

Description: The author of the callout page
Example:

2. HTTP-EQUIV Properties

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

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:
Note: The time format of GMT must be used.

B, Pragma (cache mode)

Description: Prevents the browser from accessing page content from the local computer's cache.
Usage:
Note: This setting makes it impossible for visitors to browse offline.

C, refresh (refreshed)

Description: Automatically refreshes and points to the new page.
Usage:
Note: 2 of these are meant to be automatically refreshed to URL URLs after 2 seconds of stay.

D, Set-cookie (Cookie setting)

Note: If the page expires, the cookie will be deleted.
Usage:
Note: The time format of GMT must be used.

E, Window-target (display window settings)

Description: Forces the page to appear on a separate page in the current window.
Usage:
Note: Used to prevent others from calling their own pages in the frame.

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

Description: Sets the character set used by the page.
Usage:

Second, the function of meta tags

We've covered some of the basic components of META tags, and then we'll look at the common features of META tags:

1, Help homepage by the major search engine login

One of the most important features of META tags is to set up keywords to help your homepage be logged in by major search engines, increasing the amount of site visits. In this function, the most important thing is to set the keywords and description. Because according to the search engine work principle, the search engine first sends out the robot automatically retrieves the keywords and the decription in the page, and joins it to own database, then sorts the website according to the keyword density. Therefore, we must set up keywords to improve the search clickthrough rate of the page. Let us give you an example for your reference:
When these keywords are set, the search engine automatically adds these keywords to the database and sorts them according to the density of the keywords.

2, define the use of the page language

This is the most common function of meta tags, we will see it in pure HTML code when making a Web page, it is to define the language of your Web page, when visitors visit your Web page, the browser will automatically recognize and set the language in the page, if your page is set to GB code, and the viewer does not install GB code, The Web page will only render the browser's default language as set by the viewer. Similarly, if the webpage is English, then charset=en. Here is a representative example:
  

http-equiv=″content-Type″ content=″text/html; charset=gb2312″〉

This code means that the language of the Web page is set to the GB code.

3, automatically refresh and point to the new page

If you want to make your Web page unattended, you can automatically refresh the Web page by using the META tag to access the specified page within the specified time. Let's take a look at some code:
〈meta http-equiv=″refresh″content=″2; url=http://www.root.net″〉
This code allows the current page to automatically go to the Http://www.root.net page after 2 seconds, which is the role of Meta Refresh, in content, 2 represents the set time (in seconds), and the URL is automatically connected after a specified time page address.

4, the Realization of Web page conversion animation effect

Using meta tags, we can also animate the moment we enter the page or leave the page, just add the following code between the tags in the page's HTML code:


Once the above code is added to a webpage, we will see some special effects when we go into and out of the page, this function is actually the same as the format/page transition in FrontPage2000, but we should note that the added page cannot be a frame page;

5. Website Grading evaluation

IE4.0 or later browsers can prevent browsing on some restricted sites, and the browser will automatically identify certain sites that are restricted because the level of the site has been set up in the META tag of the site, and that rating is assessed by U.S. RSAC, the Entertainment Commission's ratings agency, if you need to evaluate your own website, can connect to the website http://www.020webseo.com/, submits the form according to the request, then RSAC will provide a meta code to you, copy to own webpage to be able. Here is a sample code:

http-equiv=″PICS-Label″  content=′(PICS-1.1 ″httptrue comment ″RSACi North America Server″  for ″http://www.rsac.org″  on ″2001.08.16T08:15-0500″0000))′〉
6. Control page Buffering

Meta tags can set the time the page expires, that is, when you set the browser in Internet Explorer to view the page in the local buffer first, then when browsing a page, and local buffering and sometimes, then the browser will automatically browse the buffer in the page, The browser will not get a new page until the time set in the meta expires. For example, the following code indicates that the expiry time of the Web page is January 12, 2001 18:18 18 seconds.

〈meta http-equiv=″expires″ content=12-Jan-200118:18:18 GMT″〉
7. Control the window displayed on the page

We can also use META tags to control the window displayed on the page, just add the following code to the page:
  <meta http-equiv="window-target" content="_top">, this code prevents the page from being called by someone else as a frame.

8, Refresh (refreshed)

Description: How long (in seconds) to refresh your Web page, or how long it takes to automatically link pages to other pages.
Usage:<Meta http-equiv="Refresh" Content="30">

<Meta http-equiv="Refresh" Content="5; Url=http://www.020webseo.com">

Note: 5 of these are meant to be automatically refreshed to URL URLs after 5 seconds of stay.

9. Expires (term)

Description: Specifies the expiration time of the page in the cache and must be re-accessed on the server once the page expires.
Usage: <Meta http-equiv="Expires" Content="0">
  

<Meta http-equiv="Expires" Content="Wed, 26 Feb 1997 08:21:57 GMT">

Note: You must use the time format of GMT, or set directly to 0 (the number indicates how much time expires after).

10, Pragma (Cach mode)

Description: Prevents the browser from accessing the contents of the page from the local machine's cache.
Usage: <Meta http-equiv="Pragma" Content="No-cach">
Note: pages are not guaranteed to be present in the cache, and each visit refreshes the page. With this setting, visitors will not be able to browse offline.

11. Set-cookie (Cookie setting)

Description: When a browser accesses a page, it is cached and can be read from the cache the next time it is accessed to improve speed. Disable caching when you want visitors to refresh your ad's icon every time, or refresh your counter every time. Usually HTML files do not need to disable caching, for the ASP and other pages, you can use the disable cache, because every time you see the page is dynamically generated on the server, the cache loses meaning. If the page expires, the saved cookie will be deleted.
Usage:

<Meta http-equiv="Set-Cookie" Content="cookievalue=xxx; expires=Wednesday,  21-Oct-98 16:14:21 GMT; path=/">

Note: The time format of GMT must be used.

12, Window-target (display window settings)

Description: Forces the page to appear on a separate page in the current window.
Usage: <Meta http-equiv="Widow-target" Content="_top">
Note: This property is used to prevent others from calling your page in the frame. Content options: _blank, _top, _self, _parent.

Some other uses in the head

  1. Scheme (scheme)
Description: Scheme can be used when name was used to specify how the value of content should
be interpreted.
Usage: <meta scheme="ISBN" name="identifier" content="0-14-043205-1" />
Attention:
  2. Link (links)
Description: Linking to a file
Usage:
Note: Many sites if you save her in the Inbox, you will find that it is accompanied by a small icon, if you click again, you will find the Address bar also has a small icon. You can now easily implement this feature by adding this to your page header. Used to link the current file with other URLs, but there will be no link buttons, used in the tag room format as follows:

<link href="URL" rel="relationship">

  3, Base (link)
Description: Insert Web page Base Link property
Usage: <Base href="http://www.xia8.net/" target="_blank">
Note: All relative paths on your page will be prefixed with "http://www.cn8cn.com/" when linking. where target= "_blank" is the link file opened in a new window, you can do other settings. Change "_blank" to "_parent" is the link file will open in the parent window of the current window, instead the "_self" link file opens in the current window (frame), instead the "_top" link file is displayed in full screen.

Tips on how to use meta:

   meta tags are used to describe the properties of a Web page in a language, the standard meta tags can facilitate search engine ranking, improve search engine site weight rankings. To the site to do more in line with the search engine standards must understand the META tag, the following from Seoer to tell you about the meaning of meta-tags and how to use:
1. Meta tag keywords
The wording is:
Meat the Keywords information parameter of the label, which represents the keyword of the website.
2. Meta tag description
  
Meat tag's description information parameters, which represent the main content of the website, and what the profile is.
3. Meta tag http-equiv=content-type content= "text/html
Http-equiv=content-type represents the HTTP header protocol, prompting the browser Web page for information,
  
Meat label Description information parameters such as GB2312, the representative of the website is the use of the code is Simplified Chinese;
Meat label Description information parameters such as BIG5, the representative of the website is the use of the encoding is traditional Chinese;
Meat label Description information parameters such as ISO-2022-JP, the representative of the website is the use of the encoding is Japanese;
Meat label Description information parameters such as ks_c_5601, the representative of the website is the use of the code is Korean;
Meat label Description information parameters such as Iso-8859-1, the representative of the website is the use of the Code is English;
Meat tag Description information parameters such as UTF-8, representing the world's universal language coding;
4. Meta tag Generator
  
Meat tag's generator information parameters, which represent what software is used to create the website.
5. Meta Tag author
  
Meat the author information parameter of the label, which represents the copyright author information of the Web page.
6. Meta tag http-equiv= "Refresh"
  
The refresh of the meat tag represents how much time the page is automatically refreshed, plus the URL parameters in the URLs represent how long it takes to automatically link to other URLs.
7. Meta tag http-equiv= "Pragma" content= "No-cache"
The representative prohibits the browser from accessing the contents of the page from the local computer's cache, setting, visiting
Users will not be able to browse offline.
8. The copyright of META tags
  
Meat the Copyright information parameter of the label, which represents the information of the website.
9. Meta tag http-equiv= "Imagetoolbar"
  
Specifies whether the Picture toolbar is displayed when the false representation is not displayed, and when True represents the display.
10. Meta Tag Content-script-type
  
Web page specification that indicates the type of script in the page.
11. Meta Tag Revisit-after
  
Revisit-after on behalf of the site re-visit, 7 days for 7 day, and so on.
12. Meta tag robots
  
Robots representative tells the search engine what pages the robot crawls
The properties 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 can not 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 not be retrieved, the link on the page can be queried.
13. Meta tag
Represents the page in the current window as a separate page display, you can prevent their own web page is called by others as a frame page, settings are: _blank, _top, _self, _parent.
14. Meta Tag Set-cookie
  
On behalf of the cookie setting, if the webpage expires, the cookie will be deleted and the GMT time format must be used.

Meta-usage in HTML

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.