2014-02-18 149 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并使用图像的确切尺寸来避免缩放。

然而,这并不是一个理想的解决方案,因为响应式网页设计确实需要提供略微不同大小的图像,并允许上下文适当缩放图像,理想情况下尺寸较小。