我有一个网站,其中Internet Explorer 10完全忽略了明确设置的宽度和高度属性,而选择实际图像大小。
该图像定义为:
<img style="float: left; margin: 0px 10px 0px 0px; display: inline;"
align="left" src="http://blog.hinshelwood.com/files/2012/09/metro-findings.png"
width="64"
height="64"/>
但在IE10中,它的显示大小为128x128。而在Chrome中则如你所期望的一样。
例如:http://blog.hinshelwood.com/tfs-integration-tools-issue-tfs-wit-invalid-submission-conflict-type/
在这个页面上,“适用于”、“解决方案”和“研究结果”中的所有图片都被设置为64x64,但是在IE10中它们显示为128x128。我尝试过设置以下CSS,但它也被忽略了:
h3 img {
width: 64px;
height: 64px;
}
有没有人有任何想法为什么呢?
<img style="height:64px; width: 64px;" .../>
而不是<img height=64 width=64 ... />
在CSS出现之前,图像的属性来自早期的Web设计。但是,使用CSS样式可以覆盖传统的属性设置。 - John Liu