<script src="bootstrap/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css"> 这是bootstarp的样式表。
<script src="js/shefl.js"></script> 自己项目的脚本
<!--[if lt IE 9]> bootstarp是用html5+css3构建的,ie8以下可能对这些支持不是很友好这时我们需要写点hack,涉及到布局要引入让ie8支持html5标签和css3媒体查询。如果是其他css3效果比如圆角和css3高级选择器就要自己另外写hack和添加j兼容脚本了,因为这里不必须的 我也就没用给出。
<script src="bootstrap/IE8lower/html5shiv.js"></script> ie8支持html5标签
<script src="bootstrap/IE8lower/respond.min.js"></script> ie8支持css3媒体查询
<![endif]-->
</html>
代码下载点击打开链接
注意引入的顺序 才可兼容IE8 只要把代码复制就可以直接在body里面写你自己的东西了。
最后提醒下了:要bootstarp兼容到ie8是很简单的事情,但是兼容到ie67就有点困难了,办法是有的只是很麻烦,上次做了个项目需要支持到ie67,只能自己硬着头皮一个一个写hack了,写了一个首页的hack我就彻底的疯掉了,最后还是建议客户升级浏览器。所以在做项目的时候如果是要兼容到ie8的话才来用bootstarp这个框架。
补充:Meta:
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport"/> <meta content="yes"name="apple-mobile-web-app-capable"/> <meta content="black"name="apple-mobile-web-app-status-bar-style"/> <meta content="telephone=no"name="format-detection"/> <meta content="email=no"name="format-detection"/> <meta content="initial-scale=1.0,user-scalable=no,maximum-scale=1" media="(device-height: 568px)" name="viewport" />