html meta相关属性介绍
1. name、content组合
<meta charset="UTF-8">
<meta name="referrer" content="no-referrer"/>
<meta http-equiv="pragma" content="no-store">
- 先发送请求,与服务器确认该资源是否被更改,未被更改则使用缓存。no-siteapp避免百度打开网页时可能会对其进行转码(比如贴广告等)
<meta http-equiv="Cache-Control" content="no-cache,no-store">//
<meta http-equiv="expires" content="0">
<meta name="format-detection" content="telephone=no,email=no"/>
<meta name="wap-font-scale" content="no">
- shrink-to-fit=no是为了兼容iOS9
<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no,shrink-to-fit=no">
2. http-equiv属性
//优先使用IE最新版本和Chrome
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
//30s后刷新自己
<meta http-equiv="refresh" content="30" >
//30s后跳转到百度
<meta http-equiv="refresh" content="30;URL="http://www.baidu.com" >
<meta http-equiv="expires" content="Sat, 29 Apr 2019 04:25:02 GMT" >
- 双核浏览器的渲染方式,用于指定双核浏览器默认以何种方式渲染页面。
//默认webkit内核/默认IE兼容模式/默认IE标准模式
<meta name="renderer" content="webkit/ie-comp/ie-stand" />
- Referrer Policy规定了五种Referrer策略。referrer策略和网页安全有关,在分析用户来源时非常有用
<meta name="referrer" content="no-referrer|origin|no-referrer-when-downgrade|origin-when-crossorigin|unsafe-url" />