我试图仅使用 CSS 来限制图像宽度:
#lateral-derecho #patrocinadores img
{
max-width: 130px;
height: auto;
margin: 0 auto;
}
除了 IE 9 之外,每个浏览器都在做这件事。它没有按比例做。我在 <meta http-equiv="X-UA-Compatible" content="IE=8" />
中运行它.
顺便说一句,标准模式下的 IE 9 甚至不理解 margin: 0 auto;
或者我做错了什么?他们又做了一个蹩脚的浏览器?
编辑:这是所有 CSS、容器 (#patrocinadores) 和 img,img 包含在 #patrocinadores > a > img
中:
#lateral-derecho #patrocinadores
{
float: right;
width: 136px;
margin-top: 25px;
padding: 15px 0 5px;
background: url(images/top-patrocinadores.png) top no-repeat #eee;
text-align: center;
}
#lateral-derecho #patrocinadores a{display: block;}
#lateral-derecho #patrocinadores img
{
max-width: 130px;
height: auto;
margin: 0 auto;
}
最佳答案
试试这个:
#lateral-derecho #patrocinadores a {
display: block;
max-width: 130px;
}
#lateral-derecho #patrocinadores img {
max-width: 100%;
}
如果您想为 IE < 9 进行高质量缩放,您需要包含 AlphaImageLoader
并将 sizingMethod
设置为 scale
。
关于css - Internet Explorer 9 - 按比例调整图像大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7909696/