Search code examples
cssgradientlinear-gradients

Is there a way to make a CSS gradient choppy?


See below for an example of what I want to achieve. choppy and smooth gradient

I can see the difference between the two, but if you can't, here's another image.

smooth and choppy gradient 2


Solution

  • by applying another gradient on a top of it:

    html {
       height:100%;
       background:
         linear-gradient(transparent,rgba(0,0,0,0.03)) 0 0/100% 20px,
         linear-gradient(#1ec5a6,#fff);
    }