0
工作我用下面的代碼片段在我的CSS:最大寬度標籤不與IE
img {
/* Responsive images (ensure images don't scale beyond their parents) */
max-width: 100%;
/* Part 1: Set a maxium relative to the parent */
width: auto\9;
/* IE7-8 need help adjusting responsive images */
height: auto;
/* Part 2: Scale the height according to the width, otherwise you get stretching */
vertical-align: middle;
border: 0;
-ms-interpolation-mode: bicubic;
}
然而,max-width
不與IE瀏覽器和圖像放大。任何修復/解決方案?
'width:auto;無論如何,height:auto'是默認值,所以不需要包含它們。 (你的意思是在那裏有'\ 9'?)最大寬度應該工作,除非你在談論一個已經過時的非常老版本的IE。 – 2013-05-01 12:36:10
您使用的是什麼版本的IE?如果它是最近的版本,你有沒有檢查過你是否處於標準模式,而不是怪癖模式? – Spudley 2013-05-01 12:37:18
@ ralph.m:如果HTML img標記具有(或可能具有)「width」和「height」的HTML屬性,則需要'auto'。 'auto'覆蓋HTML屬性。 – 2013-05-01 16:53:32