在Chrome中查看http://jsfiddle.net/aJ333/1/,然后在Firefox或Internet Explorer中查看.图像最初是120像素,我缩小到28像素,但无论你将它缩小到什么程度,它看起来都很糟糕.
图像是PNG,它有一个alpha通道(透明度).
这是相关的代码:
HTML:
<a href="http://tinypic.com?ref=2z5jbtg" target="_blank">
<img src="http://i44.tinypic.com/2z5jbtg.png" border="0" alt="Image and video hosting by TinyPic">
</a>?
Run Code Online (Sandbox Code Playgroud)
CSS:
a {
width: 28px;
height: 28px;
display: block;
}
img {
max-width: 100%;
max-height: 100%;
image-rendering: -moz-crisp-edges;
-ms-interpolation-mode: bicubic;
}
Run Code Online (Sandbox Code Playgroud)
在image-rendering和-ms-interpolation-modeCSS的线条似乎并没有做任何事情,但我发现他们在网上,而做对这个问题的一些研究.