bootstrap3在ie8下有不兼容的现象,有很多解决方法:
1.声明meta
<meta http-equiv="X-UA-Compatible" content="IE=edge">(IE=edge表示强制使用IE最新内核)
2.引用第三方js,有一个叫respond.js的东西,github可以搜到
<!--[if it IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
3.引用bootstrap.min.css文件是,把文件保存到本地再引用。
4.一定要先引css再引js
5.调用方法不正确
不要用file://或@import形式引用resond.min.js或css文件
6.ie8不支持container的几个属性
ie8不完全支持box-sizing:border-box和min-width,max-width,min-height或max-height的一起使用,所以3.0+的版本中对container的类,已经不再用max-width了
7.DOCTYPE前后有空行
<!DOCTYPE html>
不能有空格,要去掉空格
8.ie8不支持媒体查询,所以对应不同不同分辨率的样式失效了,所以解决方法很简单,布局用col-xs的列布局来实现就好了
以上方法有些不好用,建议多试试。
网友评论