2014-02-18 53 views
3

我在我的網站上顯示一個.Jpg圖像。圖像在Firefox,Chrome中看起來不錯,但在IE中它看起來像素化。我正在使用IE9。圖像在IE中顯示爲像素化圖像

我的代碼:

<img src="../TestApp/images/Pic.jpg" border="0" Style="width:770px;height:auto;margin:0px;padding:0px; -ms-interpolation-mode: bicubic;" />  

我試圖-MS插值模式:雙三次;那是行不通的因爲它已經過時了

我試過-ms-interpolation-mode:nearest-neighbor;

我試圖

<div class="column"> 
<img src="../TestApp/images/Pic.jpg" border="0" Style="width:770px;height:auto;margin:0px;padding:0px; -ms-interpolation-mode: bicubic;" class="Plate"/> 
</div> 


.column { 
float:left; 
display:inline; /* prevent IE margin doubling */ 
width:360px; 
padding-top:1em; 
margin-right:60px; 
text-align:left; 
} 

.plate { 
display:block; 
margin:0 auto 0.5em; 
} 

,沒有工作。我該如何解決這個問題?

+1

圖像的內在尺寸是什麼? –

+0

爲什麼所有的隨機資本?他們不僅讓你的帖子難以閱讀,而且還會在你的代碼中積極引發問題。 –

+0

如果你需要一個thumnbail請嘗試:https://github.com/Lygin/ie-bicubic-img-interpolation-plugin/wiki – Spirit

回答

5

我能夠通過去除寬度來修復它:770px; height:auto;從圖像和大小的圖像到770px在Photoshop中,並上傳到圖像文件夾。

+3

更正,Chrome和FF在上或縮小圖像比IE更好。唯一好的解決方案是使用矢量圖像(SVG)或以實際尺寸顯示圖像(如果可能,請始終這樣做)。 – Jonathan

0

Internet Explorer不使用計算密集度更高的算法(例如Lanczos,Bi-Cubic等)來縮放其他瀏覽器供應商使用的圖像。

我會建議在瀏覽器中檢測IE並使用圖像的確切尺寸來避免縮放。

然而,這並不是一個理想的解決方案,因爲響應式網頁設計確實需要提供略微不同大小的圖像,並允許上下文適當縮放圖像,理想情況下尺寸較小。