How to get Linear gradient effect on mozilla firefox

后端 未结 4 1402
北海茫月
北海茫月 2021-01-29 02:34

I am using the following css to get the linear gradient effect, But its not working in mozilla firefox, Can anyone of you know it pls help to get the same effect in firefox also

4条回答
  •  灰色年华
    2021-01-29 03:08

    Use -moz-linear-gradient:

    background-image: -moz-linear-gradient(bottom, rgba(0, 0, 0, .65) 0,transparent);
    

    Running demo

    And the W3C version with a slightly different syntax:

    background-image: linear-gradient(to top, rgba(0, 0, 0, .65) 0, transparent);
    

    Running demo

    You should always use vendor specific prefixes (-o, -moz, and so on) before the W3C one. To prevent writing them by yourself, you can use a compile-time prefixer, like Nettus+ Prefixr, or a real-time prefixer, like Lea Verou's Prefix free.

    In the specific case of Gradients, you can use this great Gradient Generator that prefixes them for you.

提交回复
热议问题