Web page production Learning: Meta tags in the detailed

Source: Internet
Author: User
Tags add format define character set sort variable window domain name
Page | Detailed meta is an auxiliary label for the HTML language head. In almost all of the pages, we can see HTML code similar to the following paragraph:

<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">

Maybe you think the code is optional. In fact, if you can use a good meta tag, it will bring you unexpected results, such as the keyword will automatically be collected automatically by the large search site, you can set the page format and refresh and so on.


I. Composition of META tags

Meta tags have two properties, they are the Http-equiv property and the Name property, different properties 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 meat label's Name property syntax format is:

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.

Example:

B, description (Website content description)

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

For example:

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:

D, author (author)

Description: The author of the callout page

For example: content= "Lightning, web@webjx.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 meat tags 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 for GMT must be used.

B, Pragma (cache mode)

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

Usage:

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

C, Refresh (refreshing)

Description: Automatically refreshes and points to the new page.

Usage:

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:

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:

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:

Second, meta tags of the function

We've covered some of the basics of the META tags, and then we'll take a look at the common features of the META Tags:

1, help the homepage by the major search engine login

A very important function of meta tags is to set keywords to help your home page to be logged on by major search engines, and to increase the number of visits to your site. In this function, the most important is the keywords and description settings. Because according to the search engine work principle, the search engine first sends the robot to automatically retrieve the keywords and the decription in the page, and joins it to own database, then then according to the keyword density will sort the website. Therefore, we have to set a good keyword to improve the page search click-through. Let me give you an example for your reference:


After setting these keywords, the search engine will automatically add these keywords to the database and sort them according to the density of the keywords.

  2, define the use of the language of the page

This is the most common feature of META tags, and when making a Web page, we see it in pure HTML code, it is to define the language of your Web page, when viewers visit your Web page, the browser will automatically identify and set the language of the page, if you set the page is GB code, and the viewer does not install GB code, The Web page will only render the browser default language set by the viewer. Similarly, if the page is English, then charset=en. The following is a representative example:

The code indicates that the language of the Web page is set to GB code.

  3, automatically refresh and point to the new page

If you want to make your Web page in an unattended situation and automatically access the specified Web page within a specified time, you can use the META tags to automatically refresh the page's functionality. Let's look at a piece of code here:

〈meta http-equiv=″refresh″content=″2; url=http://www.webjx.com″〉

This code allows the current page to be automatically transferred to the http://www.webjx.com page in 2 seconds, which is the role of Meta Refresh, in which 2 represents the set time (in seconds). A URL is a Web page address that is automatically connected after a specified time.

  4, the implementation of Web page conversion animation effect

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

Once the above code is added to a Web page, we will see some special effects when entering and leaving the page, this function is in fact the same as the format/page transition in FrontPage2000, but we should note that the added page cannot be a frame page;

  5. Web Page Grading Evaluation

IE4.0 the above version of the browser can prevent browsing some restricted sites, the reason the browser will automatically identify certain sites is restricted, because the site is already set up in the META tags of the site, and the level of evaluation by the United States Rsac, that is, the Entertainment Committee rating agencies, If you need to evaluate your own site, you can connect to the site http://www.rsac.org/, submit the form as required, then RSAC will provide a section of meta code for you to copy to your website. The following is a sample code example:

〈meta Http-equiv=″pics-label″
content=′ (Pics-1.1″http://www.rsac.org/ratingsv01.html″
L Gen True Comment″rsaci North America Server″
For″http://www.rsac.org″
On″2001.08.16t08:15-0500″
R (N 0 s 0 v 0 L 0)) ′〉

  6, control the page buffer

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

〈meta Http-equiv=″expires″content=″friday, 12-jan-2001 18:18:18 gmt″〉

  7, control the window displayed by the Web page

We can also use META tags to control the window displayed by the page, just add the following code to the page: This code prevents the Web page from being invoked as a frame by others.



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.