引导图像响应在IE上混乱了 [英] Bootstrap Image Responsive messed up on IE

查看:65
本文介绍了引导图像响应在IE上混乱了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用Bootstrap开发网站,基本上,我具有这种结构。

I had been developing my website using Bootstrap and basically, I have this structure..

<div class="container">
    <img src="~/Content/Theme/img/image.png" class="img-responsive" style="margin: 0 auto;" />
</div>

它在Chrome和Firefox上完美运行,但是当我在Internet Explorer 9上对其进行测试时,图像变大了,甚至超出图片大小本身。当我在IE(F12)上使用调试模式并取消选中 .img响应下的 width:100%; 设置时,它会恢复正常。

It works perfectly on Chrome and Firefox but when I test it on Internet Explorer 9, the image becomes enlarged, even beyond the image size itself. when I used debug mode on IE (F12) and untick the width:100%; setting under .img-responsive, it returns to normal.

我该如何解决?我已经在这里尝试了一些解决方案,包括将 .col-sm-12 添加到图像,但是它仍无法在IE上解决。

How should I resolve this? I've already tried a few solution on here including adding .col-sm-12 to the image, but it still doesn't fix it on IE.

推荐答案

将其添加到替代样式表中:

Add this to your overrides stylesheet:

.img-responsive {width: auto;}

与<$ c Bootstrap中的$ c> max-width 语句应解决此问题。还要注意,Bootstrap v3.2.1恢复了导致问题的提交。

That, in conjunction with the max-width statement in Bootstrap, should resolve the issue. Also note that Bootstrap v3.2.1 reverted the commit that caused the issue.

Github的bug讨论#13996

这篇关于引导图像响应在IE上混乱了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆