一、常見的<meta>
1.
設(shè)置編碼信息<meta http-equiv="Content-Type" Content="text/html; Charset=utf-8" />
設(shè)置語(yǔ)言<meta http-equiv="Content-Language" Content="zh-CN" />
設(shè)置重定向 <meta http-equiv="Refresh" Content="15; Url=http://www.baidu.com" />
設(shè)置緩存時(shí)間 <meta http-equiv="Expires" Content="Web, 26 Jun 2015 18:21:57 GMT" />
不使用緩存 <meta http-equiv="Pragma" Content="No-cach" />
設(shè)置關(guān)鍵字 <meta name="Keywords" Content="key1,key2,..." />
設(shè)置描述信息 <meta name="Description" Content="description abc" />
設(shè)置對(duì)搜索引擎抓取 <meta name="Robots" Content="All|None|Index|Noindex|Follow|Nofollow" />
設(shè)置可視區(qū)域 <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
2.瀏覽器使用:
<!-- 國(guó)產(chǎn)瀏覽器內(nèi)核選擇 --> <meta name="renderer" content="webkit|ie-comp|ie-stand">
<!-- 使用最新版的ie瀏覽器,或者chrome--> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<!-- 針對(duì)手持設(shè)備優(yōu)化,主要是針對(duì)一些老的不識(shí)別viewport的瀏覽器,比如黑莓 -->
<meta name="HandheldFriendly" content="true">
<!-- 微軟的老式瀏覽器 --> <meta name="MobileOptimized" content="320">
<!-- uc強(qiáng)制豎屏 --> <meta name="screen-orientation" content="portrait">
<!-- QQ強(qiáng)制豎屏 --> <meta name="x5-orientation" content="portrait">
<!-- UC強(qiáng)制全屏 --> <meta name="full-screen" content="yes">
<!-- QQ強(qiáng)制全屏 --> <meta name="x5-fullscreen" content="true">
<!-- UC應(yīng)用模式 --> <meta name="browsermode" content="application">
<!-- QQ應(yīng)用模式 --> <meta name="x5-page-mode" content="app">
<!-- windows phone 點(diǎn)擊無高光 --> <meta name="msapplication-tap-highlight" content="no">
<!-- 禁止轉(zhuǎn)碼 --> <meta http-equiv="Cache-Control" content="no-siteapp" />
二、tabindex屬性:
1、作用:規(guī)定元素的tab鍵控制次序;
2、支持該屬性的標(biāo)簽:
<a>,<area>,<button>,<object>,<select>,<textarea>,<meta>
3、示例:
<!DOCTYPE html><html><body>
<a href="http://www.w3school.com.cn/" tabindex="2">W3School</a><br /><a href="http://www.google.com/" tabindex="1">Google</a><br /><a href="http://www.microsoft.com/" tabindex="3">Microsoft</a>
<p><b>注釋:</b>請(qǐng)嘗試使用鍵盤上的 "Tab" 鍵在鏈接之間進(jìn)行導(dǎo)航。</p>
</body></html>
三、<meta name="renderer" content="webkit">
content的取值為webkit,ie-comp,ie-stand之一,區(qū)分大小寫,分別代表用webkit內(nèi)核,IE兼容內(nèi)核,IE標(biāo)準(zhǔn)內(nèi)核。
若頁(yè)面需默認(rèn)用極速核,增加標(biāo)簽:<meta name="renderer" content="webkit">
若頁(yè)面需默認(rèn)用ie兼容內(nèi)核,增加標(biāo)簽:<meta name="renderer" content="ie-comp">
若頁(yè)面需默認(rèn)用ie標(biāo)準(zhǔn)內(nèi)核,增加標(biāo)簽:<meta name="renderer" content="ie-stand">
各渲染內(nèi)核的技術(shù)細(xì)節(jié)
內(nèi)核 |
Webkit |
IE兼容 |
IE標(biāo)準(zhǔn) |
文檔模式 |
Chrome 21 |
IE6/7 |
IE9/IE10/IE11(取決于用戶的IE) |
HTML5支持 |
YES |
NO |
YES |
ActiveX控件支持 |
NO |
YES |
YES |
【 微信掃一掃 】