How can I prevent CSS gradient banding?

后端 未结 7 1773
别那么骄傲
别那么骄傲 2020-12-05 06:20

I started using CSS gradients, rather than actual images, for two reasons: first, the CSS gradient definitely loads faster than an image, and second, they aren\'t supposed t

7条回答
  •  情歌与酒
    2020-12-05 06:53

    I made a "scatter.png" to put with my gradient. Like this:

    1. Open gimp
    2. 100x100 image
    3. Add alpha channel
    4. Filters -> Noise -> Hurl... Accept defaults
    5. Set opactity to 5%
    6. Save and then add to gradient.

      background: url('/img/scatter.png'), linear-gradient(50deg,#d00 0,#300 100%);
      

    It's a subtle effect on a subtle effect.

提交回复
热议问题