Meta tag-an essential part of a website

Source: Internet
Author: User

Today, the author accidentally discovered the meta element in the HTML language, which is located between the

This label may have been ignored by most people. At least I ignored it. The reason is that I generally use vs2008 to establish a website or B/S system and use controls to complete the design requirements. </img>, <Table> </table>, <a herf> Frequently Used websites do not consider how search engines search for webpages. However, I found that the element Meta is also very important today. First, let's take a look atSource code

View the codeproject website

 

A large number of <meta> tags are used. It doesn't matter if you don't understand the role of meta above. I will introduce Meta to you below.

 

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, the content is actually the parameters

The syntax of the HTTP-equiv attribute of the meta tag is as follows: <meta http-equiv = "parameter" content = "parameter variable value">;

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: <meta http-equiv = "expires" content = "Fri, 12 Jan 2001 18:18:18 GMT">

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: <meta http-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: <meta http-equiv = "refresh" content = "2; url = http://www.root.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: <meta http-equiv = "Set-cookie" content = "cookievalue = xxx; expires = Friday, 12-Jan-2001 18:18:18 GMT; 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: <meta http-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: <meta http-equiv = "Content-Type" content = "text/html; charset = gb2312">

 

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. After setting this attribute, you can find our website on the search engine. The most important thing is to set the keywords and description. According to the working principle of the search engine, the search engine first sends a robot to automatically retrieve the keywords and description on the page, adds them to its own database, and then sorts the Website Based on the keyword density. Therefore, we can see that the keywords description of the blog is quite comprehensive.

A. Keywords)

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

Example: <meta name = "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: <meta name = "Description" content = "this page is about the meaning of science, 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: <meta name = "Robots" content = "NONE">

D. Author (author)

Note: the author of the webpage

Example: <meta name = "author" content = "root, root@21cn.com">

We can see that the above two websites use this element to make a detailed description, in order to make the website more conducive to the search engine.

Now that we understand the meta element, I suggest you change some of our personal websites and commercial websites that do not pay much attention to meta or that do not have detailed descriptions.

 

Reference: Baidu encyclopedia http://baike.baidu.com/view/953191.htm? Fr = ala0_1

A garden-based http://www.cnblogs.com/esshs/articles/157588.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.