The <meta> element can provide meta-information about the page, such as descriptions and keywords for search engines and update frequency.
The <meta> tag is located at the head of the document and contains nothing. The attribute of the <meta> tag defines the name/value pair associated with the document.
Differences between HTML and XHTML In HTML, the <meta> tag has no end tag.In XHTML, the <meta> tag must be closed correctly.
Tips and comments:
Note: The <meta> tag is always inside the head element.
Note: Metadata is always passed in pairs as names/values.
name attributeThe name attribute provides the name in the name/value pair. Neither the HTML nor the XHTML tags specify any predefined <meta> name. Often, you are free to use names that are meaningful to yourself and the readers of the source document.
keywords is a frequently used name. It defines a set of keywords for the document. Some search engines use these keywords to classify documents when encountering these keywords.
Meta tags like this may be helpful for entering search engine indexes:
http-equiv attributeThe http-equiv attribute provides a name for the name/value pair. It instructs the server to include name/value pairs in the header of the MIME document to be transferred to the browser before sending the actual document.
When the server sends a document to the browser, many name/value pairs are first sent. Although some servers will send many of these name/value pairs, all servers will send at least one: content-type:text/html. This will tell the browser to prepare to accept an HTML document.
When using the <meta> tag with the http-equiv attribute, the server adds the name/value pair to the content header sent to the browser.
content attributeThe content property provides the value in the name/value pair. This value can be any valid string.
The content property must always be used with the name property or the http-equiv property.
scheme attributeThe scheme attribute is used to specify the scheme to use to translate the attribute value. This scenario should be defined in the profile file specified by the profile property of the <head> tag.
meta is used to simulate the response header of the HTTP protocol in HTML documents. The meta tag is used in the <head> and</head> of web pages. The meta tag is of many uses. There are two types of properties of meta: name and http-equiv. The name attribute is mainly used to describe web pages, corresponding to content (web page content), so that search engine robots can search and classify (currently, almost all search engines use online robots to automatically search meta values to classify web pages). The most important of these are description (the description of the site on search engines) and keywords (categorized keywords), so you should add a meta value to each page. The most commonly used ones are the following:
name attribute
1. <meta name=Generator contact=> is used to illustrate the generation tool (such as Microsoft FrontPage 4.0), etc.;
2. <meta name=KEYWords contact=>Explain the keywords of your web page to search engines;
3. <meta name=DEscription contact=>Tell search engines the main content of your site;
4. <meta name=Author contact=your name>Tell search engines the author of your site;
5. <meta name=Robots contact= all|none|index|noindex|follow|nofollow>
The attributes are described as follows:
Set to all: the file will be retrieved and the links on the page can be queried;
Set to none: the file will not be retrieved, and the links on the page cannot be queried;
Set as index: the file will be retrieved;
Set to follow: The links on the page can be queried;
Set to noindex: the file will not be retrieved, but the links on the page can be queried;
Set to nofollow: the file will not be retrieved, and the links on the page can be queried.
http-equiv attribute
1. <meta http-equiv=Content-Type contact=text/html;charset=gb_2312-80>
and <meta http-equiv=Content-Language contact=zh-CN> are used to explain the text and language used in homepage production;
For example, the English is the ISO-8859-1 character set, and there are also BIG5, utf-8, shift-Jis, Euc, Koi8-2 and other character sets;
2. <meta http-equiv=Refresh contact=n;url=http://yourlink> time to let the web page jump to the page within the specified time n;
3. <meta http-equiv=Expires contact=Mon,12 May 2001 00:20:00 GMT> can be used to set the expiration time of the web page. Once it expires, it must be called on the server again. It should be noted that the GMT time format must be used;
4. <meta http-equiv=Pragma contact=no-cache> is used to set the browser to prohibit the page content from the local cache, and once the web page is left, it cannot be called out from the cache again;
5. <meta http-equiv=set-cookie contact=Mon,12 May 2001 00:20:00 GMT>cookie setting. If the web page expires, the saved cookies will be deleted. It is also necessary to use the GMT time format;
6. <meta http-equiv=Pics-label contact=>Web page rating, there is a content setting in the Internet options of IE, which can prevent browsing some restricted websites, and the restriction level of the website is set through the meta attribute;
7. <meta http-equiv=windows-Target contact=_top>Force the page to be displayed as an independent page in the current window, which can prevent your web page from being called by others as a frame page;
8. <meta http-equiv=Page-Enter contact=revealTrans(duration=10,transtion=50)> and <meta http-equiv=Page-Exit contact=revealTrans(duration=20,transtion=6)> set the special effect when entering and leaving the page. This function is the format/web page transition in FrontPage, but the added page cannot be a frame page.