我在网页中使用bootstrap 3.0.3,并添加了html5shiv lib并响应lib对此进行了修复,但在Internet Explorer 8上无法使用。
我的html代码:
<div class="container">
<div class="row">
<div class="col-sm-4" style="background:red;"> </div>
<div class="col-sm-4" style="background:green;"> </div>
<div class="col-sm-4" style="background:blue;"> </div>
</div>
</div>
它在FF和Webkits浏览器中运行良好,但导致IE:
现在演示在这里,我该如何解决?
根据线程中的解决方案:Bootstrap容器元素必须包括行元素吗?,您的标记应为:
<div class="container">
<div class="row">
<div class="col-sm-4" style="background:red;"> </div>
<div class="col-sm-4" style="background:green;"> </div>
<div class="col-sm-4" style="background:blue;"> </div>
</div>
</div>
并使用此CSS在IE8中实现它:
.container
{
display:table;
width: 100%;
}
.row
{
height: 100%;
display: table-row;
}
.col-sm-4
{
display: table-cell;
}
这是工作演示
The .row
class is not required inside a .container
, but if you include then, container > row is the order not row > container (which you code)!
EDIT
It might be worth noting that respond.js
only works for local files. So if you have got css
files of bootstrap from CDN for your website on IE8, it won't work, instead, try with a local copy of bootstrap.css
Internet Explorer 8 and Respond.js
Beware of the following caveats when using Respond.js in your development and production environments for Internet Explorer 8.
Respond.js and cross-domain CSS Using Respond.js with CSS hosted on a different (sub)domain (for example, on a CDN) requires some additional setup. See the Respond.js docs for details.
Respond.js和file://由于浏览器安全规则,Respond.js不适用于通过file://协议查看的页面(例如打开本地HTML文件时)。要测试IE8中的响应功能,请通过HTTP(S)查看您的页面。有关详细信息,请参见Respond.js文档。
Respond.js和@import Respond.js不适用于通过@import引用的CSS。特别是,已知某些Drupal配置使用@import。有关详细信息,请参见Respond.js文档。
IE兼容模式旧的Internet Explorer兼容模式不支持Bootstrap。为确保您使用的是IE的最新呈现模式,请考虑在页面中包含适当的标记:
资料来源:Getbootstrap
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句