Meta tags

role

1.For example: name="keywords"
    name="description"
2.Set the cache mechanism, for example, http-equiv="expires"
    http-equiv="Cache-Control"
3.It can refresh automatically, for example, http-equiv="Refresh"
Copy the code

The name attribute

role

1. Describe a web page. 2. The working principle of search engine: it is search and classification according to the keywords and description content of these web pagesCopy the code

format

<meta name=" parameter type "content=" parameter specific ">Copy the code

example

name="keywords"[url] content="Lxxyx, blogger, engineering student, front end."
    
name="description"Content ="Engineering student, loves front-end and programming. Currently a sophomore, this is my front-end blog. ""
    
name="viewport"[Mobile window] View mode Content ="width=device-width,initial-scale=1"Responsive design width: Controls the size of the viewport. A value can be specified, such as600, or a special value, such as device-width for the width of the device100% CSS pixels). Height: specifies the height corresponding to width. Initial-scale: the initial scale of the page when it is first loaded. User-scalable: Whether users can scale manually. Maximum-scale: indicates the maximum scale to which the user is allowed to scale. Minimum-scale: The minimum scale to which the user is allowed to scale. name="robots"[Index] Content ="none"[Search engines will ignore this page] content="noindex"Search engines do not index this page content="nofollow"Search engines do not continue to search for other pages through the link index of this page content="all"[Search engines will index this page] content="index"Search engines index this page content="follow"Search engines continue to search for other pages through the link index of this page name="renderer"[Render mode] Content ="webkit"
    content="ie-comp"
Copy the code

HTTP – equiv properties

role

1. [Returns some useful information to the browser] 2. To help display the web content correctly and accuratelyCopy the code

format

<meta name=" parameter type "content=" parameter specific ">Copy the code

example

http-equiv="expires"[Page cache expiration time] content="Fri,01Jan201618:18:18GMT"Must use the GMT time format must be retransmitted from the server when it expires http-equiv="Cache-Control"[Set caching mechanism] content="max-age=3600"The cache validity time is3600Second the content ="no-cache"Negotiation caching HTTP1 directly without caching1.Most browsers now use http-equiv="Pragma"[Setting no cache] content="no-cache"    HTTP/1.0Http-equiv = for compatibility with the above"Refresh"[Automatically refreshes and points to new pages] Content ="2; URL=http://www.jb51.net"stay2Automatically refresh to URL http-equiv= after seconds"Set-Cookie"[Cookie setting] Content ="cookievalue=xxx; Expires =Wednesday, 20-Jun-2007 22:33:00 GMT; path=/"
        
http-equiv="content-Type"[character set] content="text/html; charset=gb2312"The encoding is simplified Chinese content="text/html; charset=big5"Encoding is traditional Chinese http-equiv="content-Language"Display language Settings content="zh-cn"
Copy the code