必要属性
属性 | 值 | 描述 |
---|---|---|
content | some text | 定义与http-equiv或name属性相关的元信息 |
可选属性
属性 | 值 | 描述 |
---|---|---|
http-equiv | content-type / expire / refresh / set-cookie | 把content属性关联到HTTP头部。 |
name | author / description / keywords / generator / revised / others | 把 content 属性关联到一个名称。 |
content | some text | 定义用于翻译 content 属性值的格式。 |
name="keywords" content="your tags" />
name="description" content="150 words" />
name="robots" content="index,follow" />
http-equiv="refresh" content="0;url=" />
name="author" content="author name" />
name="google" content="index,follow" />
name="googlebot" content="index,follow" />
name="verify" content="index,follow" />
charset='utf-8' />
http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
http-equiv="X-UA-Compatible" content="IE=6" >
http-equiv="X-UA-Compatible" content="IE=7" >
http-equiv="X-UA-Compatible" content="IE=8" >
name="renderer" content="webkit|ie-comp|ie-stand">
国内双核浏览器默认内核模式如下:
1. 搜狗高速浏览器、QQ浏览器:IE内核(兼容模式)
2. 360极速浏览器、遨游浏览器:Webkit内核(极速模式)
http-equiv="Pragma" content="no-cache">
name="msapplication-TileColor" content="#000"/>
name="msapplication-TileImage" content="icon.png"/>
name="mobile-agent"content="format=[wml|xhtml|html5]; url=url">
http-equiv="Cache-Control" content="no-siteapp" />
name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0, user-scalable=no"/>
注意,很多人使用initial-scale=1到非响应式网站上,这会让网站以100%宽度渲染,用户需要手动移动页面或者缩放。如果和initial-scale=1同时使用user-scalable=no或maximum-scale=1,则用户将不能放大/缩小网页来看到全部的内容。
name="apple-mobile-web-app-capable" content="yes" />
name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
name="apple-mobile-web-app-title" content="标题">
content="telephone=no" name="format-detection" />
content="email=no" name="format-detection" />
name="apple-itunes-app" content="app-id=myAppStoreID, affiliate-data=myAffiliateData, app-argument=myURL">
name="HandheldFriendly" content="true"> name="MobileOptimized" content="320"> name="screen-orientation" content="portrait"> name="x5-orientation" content="portrait"> name="full-screen" content="yes"> name="x5-fullscreen" content="true"> name="browsermode" content="application"> name="x5-page-mode" content="app"> name="msapplication-tap-highlight" content="no">