<!DOCTYPE html>
<html lang="en">
<head>
? ? <!-- 編碼格式 -->
? ? <meta charset="UTF-8">
? ? <title></title>
? ? <!-- 作者 -->
? ? <meta name="author" content="author">
? ? <!-- 網(wǎng)頁(yè)描述 -->
? ? <meta name="description" content="hello">
? ? <!-- 關(guān)鍵字使用","分隔 -->
? ? <meta name="keywords" content="a,b,c">
? ? <!-- 禁止瀏覽器從本地機(jī)的緩存中調(diào)閱頁(yè)面內(nèi)容 -->
? ? <meta http-equiv="Pragma" content="no-cache">
? ? <!-- 用來(lái)防止別人在框架里調(diào)用你的頁(yè)面 -->
? ? <meta http-equiv="Window-target" content="_top">
? ? <!-- content的參數(shù)有all,none,index,noindex,follow,nofollow,默認(rèn)是all -->
? ? <meta name="robots" content="none">
? ? <!-- 收藏圖標(biāo) -->
? ? <link rel="Shortcut Icon" href="favicon.ico">
? ? <!-- 網(wǎng)頁(yè)不會(huì)被緩存 -->
? ? <meta http-equiv="Cache-Control" content="no-cache, must-revalidate">
? ? <!-- 解決部分兼容性問(wèn)題,如果安裝了GCF,則使用GCF來(lái)渲染頁(yè)面,如果未安裝GCF,則使用最高版本的IE內(nèi)核進(jìn)行渲染。 -->
? ? <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
? ? <!-- 頁(yè)面按原比例顯示 -->
? ? <meta name="viewport" content="width=device-width, initial-scale=1">
? ? <link rel="stylesheet" href="plugin/bootstrap-3.3.0/css/bootstrap.min.css">
? ? <!--[if lt IE 9]>
? ? ? <script src="https://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
? ? ? <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.js"></script>
? ? <![endif]-->
</head>
<body>
? ? <script src="plugin/jquery/jquery-1.11.2.min.js"></script>
</body>
</html>
注:其中?html5shiv.min.js 文件是讓不(完全)支持html5的瀏覽器支持 html5 標(biāo)簽;respond.js 文件是讓IE8實(shí)現(xiàn)對(duì)媒體查詢(xún)(media query)的支持。
但是,在IE8瀏覽器中打開(kāi)頁(yè)面發(fā)現(xiàn),兼容性問(wèn)題并沒(méi)有得到解決(坑、坑、坑)。通過(guò)查閱相關(guān)資料,筆者總結(jié)幾點(diǎn)注意事項(xiàng)(效果實(shí)現(xiàn)的關(guān)鍵):
本地調(diào)試需要Web Server(如IIS、Apache,Nginx),單純地本地打開(kāi)文件不能看到兼容效果;
如果你發(fā)現(xiàn)已經(jīng)引用了?respond.js?和 Bootstrap,仍無(wú)效果,請(qǐng)查看你的Bootstrap是否使用了CDN文件;
Bootstrap3 需要Html5文檔聲明;
Jquery 版本需要在2.0以下。