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 tagsHEADarea Key tags provide basic information such as documentcharacter set, language used, author, etc., as well as settings for keywords and web page levels. The biggest role is to enablesearchengine 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/HTMLCodeCopy content to clipboard
metacharset="gbk">
metaname="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!"><
metaname="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 clipboard
XML/HTML Code
Copy content To clipboard
XML/HTML Code
Copy content to clipboard
XML/HTML Code
Copy content to clipboard
XML/HTML Code
Copy content to the clipboard
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.
Valuename
nameAttributeis 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 | GB2312, it means that the encoding used by the website is Simplified Chinese; whenISO-8859-1, it means that the encoding used by the website is English; 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 ofIE browserrendering method to solve some compatibility issues. | The above code tells the IE browser whether or notDTD# 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 |
Set the expiration time of the web page. | PS: The GMT time format must be used | |
to automatically refresh and point to the new page. | PS: 2 means that the page will stay for 2 seconds and then jump to the following URL | |
If the web page expires, then automatically | DeleteLocal cookies. | PS: GMT time format must be used. |
Forcing 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 others | ||
Caching mechanism | 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!