In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the knowledge of "how to use meta tags in html". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Introduction to meta tags
The meta tag is an auxiliary tag in the head area of the HTML language, which is often used to define the description of the page, keywords, date last modified, and other metadata. This metadata will serve browsers, search engines and other web services.
The composition of meta tags
The meta tag has two attributes, the http-equiv attribute and the name attribute.
Name attribute
Name attributes are mainly used to describe web pages, such as keywords, descriptions and so on. The corresponding attribute value is that the content in content,content is a specific description of the filling type of name, which is convenient for search engines to crawl.
The syntax format of the name attribute in the meta tag is:
one
The name attribute has the following parameters. (Amurc is a common attribute)
(1) keywords (keywords)
Description: used to tell search engines the keywords of your web page. For example:
one
(2) description (description of website content)
Description: used to tell search engines the main content of your site. For example:
one
(3) viewport (window of mobile terminal)
Explanation: this concept is more complex and will be discussed in the next blog post. This property is often used to design mobile web pages. Viewport has been used when using frameworks such as bootstrap,AmazeUI.
one
(4) robots (defines the index method of search engine crawlers)
Description: robots is used to tell crawlers which pages need to be indexed and which pages do not. The parameter to content is all,none,index,noindex,follow,nofollow. The default is all.
one
The specific parameters are as follows:
1. None: the search engine will ignore this page, which is equivalent to noindex,nofollow.
2. Noindex: search engines do not index this page.
3. Nofollow: search engines do not continue to search for other pages through the link index of this page.
4. All: the search engine will index this page and continue to index links through this page, which is equivalent to index,follow.
5. Index: search engines index this page.
6. Follow: the search engine continues to search for other pages through the link index of this page.
(5) author (author)
Description: used to mark web page authors for example:
one
(6) generator (web page creation software)
Description: an example used to indicate what software a web page is made of: (I don't know if it can be written in this way):
one
(7) copyright (copyright)
Description: used to mark copyright information for example:
one
/ / indicates that the website is personally copyrighted by PHP Chinese website.
(8) revisit-after (search engine crawler revisit time)
Note: if the page is not updated frequently, in order to reduce the pressure on the server caused by the search engine crawler, you can set a crawler's revisit time. If the revisit time is too short, the crawler will access it at the default time they define. For example:
one
(9) renderer (dual-core browser rendering mode)
Description: renderer is for dual-core browsers and is used to specify how dual-core browsers render pages by default. Let's say 360 browser. For example:
one
two
three
/ / default webkit kernel
/ / default IE compatibility mode
/ / default IE standard mode
Http-equiv attribute
Http-equiv, as its name implies, is equivalent to the role of HTTP.
The syntax format of the http-equiv attribute in the meta tag is:
one
The http-equiv attribute mainly has the following parameters:
(1) content-Type (set web character set) (recommended way to use HTML5)
Description: used to set the character set of web pages, making it easy for browsers to parse and render pages.
one
/ / Old HTML, not recommended
one
/ / HTML5 sets the character set of a web page. It is recommended to use UTF-8.
(2) X-UA-Compatible (which version does the browser take to render the current page)
Description: used to tell the browser which version to render the page. (it is generally set to the latest mode, and this setting is also common in major frameworks. )
one
/ / specify that IE and Chrome render the current page with the latest version
(3) cache-control (specify the caching mechanism that requests and responses follow)
Description: instructs the browser how to cache a response and how long to cache it
one
There are several uses as follows:
No-cache: send the request first, confirm with the server whether the resource has been changed, and if not, use the cache.
No-store: caching is not allowed. You have to go to the server every time to download the complete response. (security measures)
Public: all responses are cached, but not required. Because max-age can do the same thing.
Private: cached only for a single user, so no relay is allowed for caching. (for example, CDN does not allow caching of private responses)
Maxage: indicates that the current request starts and how long the response can be cached and reused without going to the server to re-request. For example: max-age=60 indicates that the response can be cached and reused for another 60 seconds.
Prohibit Baidu from transcoding automatically
Description: used to prohibit the current page from being automatically transcoded by Baidu when browsing on the mobile side. Although Baidu's original intention is good, but the transcoding effect is often not satisfactory. So you can add the sentence in the example to head to avoid Baidu's automatic transcoding.
one
(4) expires (expiry time of web pages)
Description: used to set the expiration time of the web page. After expiration, the web page must be retransmitted to the server.
one
(5) refresh (automatically refresh and point to a page)
Description: the web page will be automatically refreshed and redirected to the set URL within the set time.
one
/ / it means to jump to PHP Chinese website after 2 seconds
(6) Set-Cookie (cookie setting)
Description: if the page is out of date. Then the local cookies of this page will also be deleted automatically.
one
two
/ / format
/ / specific examples
This is the end of the content of "how to use meta tags in html". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.