Firefox通过外部CSS或内联样式缩放时会模糊图像。 [英] Firefox blurs an image when scaled through external CSS or inline style.

查看:139
本文介绍了Firefox通过外部CSS或内联样式缩放时会模糊图像。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在视觉上缩放图像时,Firefox 3模糊了它。 Firefox 2和其他浏览器不,这是我期望的行为。

When I visually scale an image, Firefox 3 blurs it. Firefox 2 and other browsers don't, which is the behavior I expect. This is especially lame for creating a web based game using png or gif sprites.

例如,当在Firefox 3中显示一个100x100的图像时,这样:

For example, when showing a 100x100 image in Firefox 3 like this:

<img src="sprite.gif" width="200" />

<img src="sprite.gif" style="width:200px; height:200px;" />

它在FF3中模糊,而不是在IE。

it looks blurred in FF3, not in IE.

有关如何防止此问题的任何建议吗?

Any ideas on how to prevent this?

推荐答案

我发现了FireFox的这个新功能:

I discovered this new feature of FireFox:

http://developer.mozilla.org/ En / CSS /图像渲染

因此,将其放入您的CSS将会修复:

So putting this in your CSS will fix it:

image-rendering: -moz-crisp-edges;

我想分享这个信息。对不起,回答我自己的问题;)

Thought I'd share this info. Sorry for answering my own question ;)

这篇关于Firefox通过外部CSS或内联样式缩放时会模糊图像。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆