bootstrap IE8 兼容性處理

bootstrap IE8 兼容性處理
!DOCTYPE htmlhtml lang="zh-CN"headmeta charset="utf-8"meta http-equiv="X-UA-Compatible" content="IE=edge"meta name="viewport" content="width=device-width, initial-scale=1"titleBootstrap IE8兼容性/titlelink rel="external nofollow" rel="stylesheet"link rel="stylesheet" type="text/css" rel="external nofollow" /!--[if lt IE 9]script src="https://www.questions.com.cn//cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"/scriptscript src="https://www.questions.com.cn//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"/script![endif]--/headbodydiv class="container"div class="row"div class="col-sm-6" style="border: 1px solid red;"左側/divdiv class="col-sm-6" style="border: 1px solid green;"右側/div/div/div/body/html針對 IE8 仍然需要額外引入 Respond.js 文件以支持媒體查詢(media query) 。
1、http協議下效果(如:http://192.168.12.40:8020/bootstrap/index.html):
2、file文件協議IE8下效果(如:C:UsersdellDocumentsHBuilderProjectbootstrapindex.html)
如上圖所示,已經不支持柵格布局 。
主要存在的問題是:
Respond.js 與 file:// 協議
由于瀏覽器的安全機制,Respond.js 不能在通過 file:// 協議(打開本地HTML文件所用的協議)訪問的頁面上發揮正常的功能 。如果需要測試 IE8 下面的響應式特性,務必通過 http 協議訪問頁面(例如搭建 apache、nginx 等) 。
【bootstrap IE8 兼容性處理】以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持經驗啦網 。
您可能感興趣的文章:BootStrap下拉框在firefox瀏覽器界面不友好的解決方案Bootstrap編寫一個兼容主流瀏覽器的受眾門戶式風格頁面Bootstrap編寫一個兼容主流瀏覽器的受眾巨幕式風格頁面Bootstrap 3瀏覽器兼容性問題及解決方案

相關經驗推薦