图像调整大小在IE8中不适用于bootstrap框架

时间:2012-12-26 05:24:27

标签: image twitter-bootstrap internet-explorer-8 resize

我一直在黑客攻击并挖掘google + stackoverflow,希望找到与我的问题相关的相关解决方案但无法找到:

我正在使用bootstrap(twitter)ver 2.0,并且遇到图像调整大小在IE8上不起作用,但在其他浏览器上工作。

图片大小调整的原始代码是:

 <img src="alpha1-stamp.png" width="70" height="70">

它在Safari,Firefox和谷歌浏览器等浏览器中表现得非常好,但不是IE8(我在另一个桌面上唯一的版本,但认为它不适用于所有IE版本)

请建议并迫切需要修复这个IE噩梦

干杯

6 个答案:

答案 0 :(得分:2)

好吧,最后让它排序并找到了破解bootstrap.css文件的方法

在bootstrap.css(bootstrap框架)

上发表以下评论
/*
img {
  width: auto\9;
  height: auto;
  max-width: 100%;
  vertical-align: middle;
  border: 0;
  -ms-interpolation-mode: bicubic;
} */

答案 1 :(得分:1)

在bootstrap.css(bootstrap框架)

上发表以下评论
img {
  width: auto\9;
  height: auto;
 /* max-width: 100%;*/
  vertical-align: middle;
  border: 0;
  -ms-interpolation-mode: bicubic;
}

答案 2 :(得分:0)

我遇到了Internet Explorer的问题&lt; 8不尊重宽度&amp;我的img标签的高度属性,并且能够解决它只删除height:auto选择器的img规则。 (删除最大宽度没有帮助)

答案 3 :(得分:0)

如果从bootstrap css中删除一些代码没有帮助,你可以尝试这个=&gt; https://stackoverflow.com/a/17763577/789012

至于我删除它后,Chrome中的布局与Mozilla或IE中的方式相同...

答案 4 :(得分:0)

问题在于 width: auto\9; height: auto; 如果你评论这一行,它在IE上正常工作

答案 5 :(得分:0)

我通过在HTML中破解条件覆盖样式来解决它。

我已经在bootstrap样式表下面有一个IE8解决方法部分,所以我添加了问题图像的重置:

<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet" />

<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <style type="text/css">
      img, img.img-responsive {
     width:auto;
     height:auto;
     max-width: none;
      }
    </style>

<![endif]-->
<style type="text/css">