IE8非兼容模式,图像具有最大宽度和高度:自动 [英] IE8 non-compatibility mode, image with max-width and height:auto
本文介绍了IE8非兼容模式,图像具有最大宽度和高度:自动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有这个标记的图片
<img src="wedding_00.jpg" width="900" height="600" />
我使用CSS缩小到600px宽,像这样:
And I am using CSS to downsize it to 600px width, like so:
img {
max-width:600px;
height:auto;
}
任何人都可以解释为什么这种方法在兼容模式下工作, ?有没有办法我可以修改我的CSS,以便它将在标准模式下工作?
Can anyone explain why this method works in Compatibility mode, but not in standard mode? Is there a way I can modify my CSS so that it will work in standard mode?
我意识到,如果我去掉了
I realize that if I strip out the
width="900" height="600"
$ b
that it solves the problem, but that is not an option I have.
推荐答案
我不确定是否可以解决问题根本原因,但如果你添加
I'm not sure of the root cause but if you add
width: auto;
那么它工作。
这篇关于IE8非兼容模式,图像具有最大宽度和高度:自动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文