开发者

Box Shadow in Firefox

开发者 https://www.devze.com 2023-02-13 04:23 出处:网络
I have a problem with box-shadow in Firefox - it \"lags\": This is my CSS: -moz-box-shadow : 0 0 5px #333;

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 nor开发者_开发问答mally (without "lag"), but in Firefox it's slow.

How can I fix this?


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;
    }
}
0

精彩评论

暂无评论...
验证码 换一张
取 消