bootstrap IE8 兼容性處理
bootstrap IE8 兼容性處理
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap IE8兼容性</title>
<link href="css/bootstrap.min.css" rel="external nofollow" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="css/font-awesome.min.css" rel="external nofollow" />
<!--[if lt IE 9]>
<script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="row">
<div class="col-sm-6" style="border: 1px solid red;">
左側(cè)
</div>
<div class="col-sm-6" style="border: 1px solid green;">
右側(cè)
</div>
</div>
</div>
</body>
</html>
針對 IE8 仍然需要額外引入 Respond.js 文件以支持媒體查詢(media query)。
1、http協(xié)議下效果(如:http://192.168.12.40:8020/bootstrap/index.html):

2、file文件協(xié)議IE8下效果(如:C:\Users\dell\Documents\HBuilderProject\bootstrap\index.html)

如上圖所示,已經(jīng)不支持柵格布局。
主要存在的問題是:
Respond.js 與 file:// 協(xié)議
由于瀏覽器的安全機(jī)制,Respond.js 不能在通過 file:// 協(xié)議(打開本地HTML文件所用的協(xié)議)訪問的頁面上發(fā)揮正常的功能。如果需要測試 IE8 下面的響應(yīng)式特性,務(wù)必通過 http 協(xié)議訪問頁面(例如搭建 apache、nginx 等)。
以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
相關(guān)文章
jquery插件jquery.confirm彈出確認(rèn)消息
這篇文章介紹了插件jquery.confirm彈出確認(rèn)消息的實(shí)現(xiàn)方法,感興趣的小伙伴們可以參考一下2015-12-12
video.js 實(shí)現(xiàn)視頻只能后退不能快進(jìn)的思路詳解
這篇文章主要介紹了video.js 實(shí)現(xiàn)視頻只能后退不能快進(jìn)的思路詳解,主要思路是點(diǎn)擊進(jìn)度條需要獲取拖動(dòng)前的時(shí)間點(diǎn),具體實(shí)例代碼大家跟隨小編一起看看吧2018-08-08

