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;

那么它工作。