人生若只如初见 - meta https://blog.ilingku.com/tag/meta/ 在HTML中用meta的多种应用方法 https://blog.ilingku.com/archives/24/ 2026-04-12T09:15:00+08:00 meta兼容模式控制:浏览器默认内核的指定只需在head标签中添加一行代码即可:若页面需默认用极速核,增加标签:若页面需默认用ie兼容内核,增加标签:若页面需默认用ie标准内核,增加标签:极速模式可以连同下面代码一起使用,增加兼容性!<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">meta访问设备控制:<meta name="mobile-agent" content="format=html5;url=https://m.ilingku.com/">PC与手机之间的适配,当手机用户通过移动PC页(或者说默认页)时,站点将其自动适配到该PC页面对应的手机页,并为之选择合适的页面版本,反之也可以在手机页跳转到网页,已达到网站权重的集中。name=”mobile-agent”:为更新后的meta声明,建议使用。原有meta规则http-equiv=”mobile-agent”能够兼容并继续生效,已标注过的无需修改。format=html5:根据手机页的协议语言,选择中的一种。(包括wml|xhtml|html5)url=/m:代表当前PC页所对应的手机页/m,两者必须是一一对应关系(而不是统一对应至手机站首页)meta访问跳转:可用于404页自动跳转,“Refresh”表示刷新,“content=2.5”是控制多少时间跳转,“url=https://”是跳转到指定的页面,可用于自动刷新并指向新页面。<meta http-equiv="refresh" content="2.5;url=https://www.ilingku.com">使用最新的引擎渲染网页:<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> <meta name="renderer" content="webkit"/>手机H5兼容模式:<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0 ,maximum-scale=1.0, user-scalable=no" />允许跨域访问 :<meta http-equiv="Access-Control-Allow-Origin" content="*">发送referrer,突破403限制,绕过防盗链:<meta name="referrer" content="never">不缓存网页:<meta http-equiv="expires" content="0" />用法:<meta http-equiv="Expires" contect="Mon,12 May 2001 00:20:00 GMT">说明:Expires(期限),用于设定网页的到期时间,过期则必须到服务器上重新调用 ;content=”-1″,网页在任何时候都不能被Cache存储不缓存网页:<meta http-equiv="pragma" content="no-cache" />说明:禁止浏览器从本地计算机的缓存中访问页面内容,是用于设定禁止浏览器从本地机的缓存中调阅页面内容,设定后一旦离开网页就无法从Cache中再调出强制缓存在任何情况下都不要保留任何副本:<meta http-equiv="Cache-Control" content="no-store"/>Pics-label(网页等级评定):<meta http-equiv="Pics-label" contect="">