The following will bring you a summary of the use of html meta tags (recommended). The editor thinks it’s pretty good, so I’ll share it with you now and give it as a reference. Let’s follow the editor and take a look.
meta tag function
META tag is one of the HTML tags HEAD area Key tags provide basic information such as document character set , language used, author, etc., as well as settings for keywords and web page levels. The biggest role is to enable search engine optimization ( SEO).
PS: It is convenient for search engine robots to search and classify. Internet applications should pay attention to it.
How to write large websites? Before understanding this tag, I searched for their Meta settings on various mainstream websites, as follows:
Meta settings on JD.com’s homepage:
XML/HTML CodeCopy content to clipboard
meta charset="gbk">
meta name="description" content="Jingdong JD.COM-Professional comprehensive The online shopping mall sells tens of thousands of brands of high-quality products such as home appliances, digital communications, computers, household department stores, clothing, maternal and infant products, books, food, etc. Convenient and honest services provide you with a pleasant online shopping experience!"><
meta name="Keywords" content="Online shopping, online shopping mall, mobile phone, notebook, computer, MP3, CD, VCD, DV, camera, digital, accessories, watch, memory card, Jingdong">Meta settings for Taobao homepage:
##XML/HTML Code
Copy content to clipboard1 2 3 4 5 6 |
|
XML/HTML Code
Copy content To clipboard1 2 3 4 5 |
|
XML/HTML Code
Copy content to clipboard1 2 3 4 5 |
|
XML/HTML Code
Copy content to clipboard
1 2 3 4 5 6 |
|
XML/HTML Code
Copy content to the clipboard1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|
meta tag can be divided into two parts: http-equiv and namevariable.
http-equiv is equivalent to the file header of http. It can return some useful information to the browser to help the browser correctly Display web page content.
ValueDescriptionSet the character set used by the pageGB2312, it means that the encoding used by the website is Simplified Chinese; when ISO-8859-1, it means that the encoding used by the website is English; when expiresSet the expiration time of the web page. refresh to automatically refresh and point to the new page. set-cookieIf the web page expires, then automatically windows-targetForcing the page to be displayed as an independent page in the current window can prevent your own web page from being called as a frame page by otherscache-controlCaching mechanism name
nameAttribute is mainly used to describe the web page. The corresponding attribute value is content. The content in content is mainly for search engine robots to find. Information and classification information.
Example | content-type | |
When |
UTF-8 , represents the world's universal language encoding; PS: The method for html5 pages is to directly use |
|
X-UA-Compatible | Special tag for IE8, used to specify IE8 browser to simulate a specific version of IE browser rendering method to solve some compatibility issues. |
The above code tells the IE browser whether or not DTD# is used ##State the document standard. IE8/9 will use the IE7 engine to render the page. The above code tells the IE browser that IE8/9 will use the IE8 engine to render the page. The above code tells the IE browser that IE8/9 and later versions will use the highest version of IE to render the page. The above code IE=edge tells IE to use the latest engine to render web pages, and chrome=1 can activate Chrome Frame.PS: Google adds a plug-in: Google Chrome Frame (Google embedded browser |
PS: The GMT time format must be used | ||
PS: 2 means that the page will stay for 2 seconds and then jump to the following URL | ||
DeleteLocal cookies. | PS: GMT time format must be used. | |
Public: Indicates that the response can be cached by any cache area. Private: Indicates that all or part of the response message for a single user cannot be processed by the shared cache. This allows the server to only describe a partial response from a user that is not valid for other users' requests. no-cache: Indicates that the request or response message cannot be cached. no-store: Used to prevent important information from being released unintentionally. Sending it in the request message will cause both the request and response messages to use caching. max-age: Indicates that the client can receive responses with a lifetime no 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 response messages beyond the timeout period. If you specify a value for max-stale messages, the client can receive response messages that exceed the specified value of the timeout period. |
Through the big website for meta In the settings, you can see that the commonly used ones are X-UA-Compatible, keywords, and description.
【Related recommendations】1.Html free video tutorial
2. Share an integration of HTML knowledge points
3. Solution to various situations where divs are covered by iframes
4. Teach you how to insert links in html
5. Teach you how to parse html under nodejs
The above is the detailed content of Detailed explanation of examples of meta tags in html. For more information, please follow other related articles on the PHP Chinese website!