Box Shadow in Firefox

匿名 (未验证) 提交于 2019-12-03 08:46:08

问题:

I have a problem with box-shadow in Firefox - it "lags":

This is my CSS:

-moz-box-shadow : 0 0 5px #333; -webkit-box-shadow : 0 0 5px #333; box-shadow : 0 0 5px #333;

In Chrome, it works normally (without "lag"), but in Firefox it's slow.

How can I fix this?

回答1:

This has been a known bug in Firefox for years. Box-shadow can cause slow scrolling or, when you are animating an element to which box-shadow is assigned, Firefox can crawl. The fix is to eiher restrict blur radius to 10px or filter out the box-shadow from Firefox:

.fubar {     box-shadow: 10px 10px 30px #000;     -moz-box-shadow:none !important; }  @-moz-document url-prefix() {     .fubar {         box-shadow:none;     } }


转载请标明出处:Box Shadow in Firefox
文章来源: Box Shadow in Firefox
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!