css image-rendering属性用于浏览器如何处理图片呈现。IE下使用-ms-interpolation-mode,在IE7下只支持图片不支持透明,且默认值为"nearest-neighbor"(底质量),而IE8默认值是"bicubic"(高质量),IE9以上此属性已经过时。
75%
100%
150%
经过处理
原始图片
经过处理
img.img{
image-rendering:-moz-crisp-edges;/*Firefox*/
image-rendering:-o-crisp-edges;/*Opera*/
image-rendering:-webkit-optimize-contrast;/*Webkit(non-standardnaming)*/
image-rendering:crisp-edges;
-ms-interpolation-mode:nearest-neighbor;/*IE(non-standardproperty)*/
}
以上比较适合矢量图,如果是位图放大将会出现毛边,如果想去除毛边可写:
img.high{
-ms-interpolation-mode:bicubic;/*IE7+*/
image-rendering:optimizeQuality;/*Fx,(Gecko1.9.2)*/
}
关键词: css,图片失真 编辑时间: -11-02 19:55:40