為了改善您的使用體驗,本網站正在進行維護,部分功能暫時無法使用。若本站的文件無法解決您的問題,想要向社群發問的話,請到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 發問,我們的社群成員將很快會回覆您的疑問。

搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

The CSS Filter method using SVG adopted by many for FF is no longer working.

more options

To grayscale an image, many websites reference using an SVG file for Firefox due to lack of support of the filter: grayscale option. This website has an example: http://labs.voronianski.com/css3-grayscale/

However, the FF v38.0.5 does not support this. I was able to get it to work with filter: grayscale(1); but it breaks backward compatibility. How do we assure that old FF's will work as well as new ones? When did this change?

Thanks!

George

To grayscale an image, many websites reference using an SVG file for Firefox due to lack of support of the filter: grayscale option. This website has an example: http://labs.voronianski.com/css3-grayscale/ However, the FF v38.0.5 does not support this. I was able to get it to work with filter: grayscale(1); but it breaks backward compatibility. How do we assure that old FF's will work as well as new ones? When did this change? Thanks! George

所有回覆 (3)

more options

On the test site, the image on the right is grayed for me. You still see it in color? We probably have different add-ons and customized settings, so I'm not sure what the "default" behavior is.

The "Live example" in the Grayscale section of the MDN page uses
filter: grayscale(100%) so I think that should still be supported:

https://developer.mozilla.org/docs/Web/CSS/filter

more options

geobehr said

To grayscale an image, many websites reference using an SVG file for Firefox due to lack of support of the filter: grayscale option. This website has an example: http://labs.voronianski.com/css3-grayscale/ However, the FF v38.0.5 does not support this. I was able to get it to work with filter: grayscale(1); but it breaks backward compatibility. How do we assure that old FF's will work as well as new ones? When did this change? Thanks! George

Thanks that answers part of my question (ie Filter was first supported in FF 34 and fully supported in FF 35. The 2nd part not answered is how do we maintain backward compat for FF <34?

Here's a website that shows the SVG grayscale approach no longer working: http://mattsnider.com/applying-grayscale-using-css-filters/

more options

I think the difference between the two sites is that the second one has a missing file (screen shots attached).