how to make a css gradient stop after so many pixels?

前端 未结 4 723
-上瘾入骨i
-上瘾入骨i 2021-02-05 08:14
-moz-radial-gradient(center -200px , ellipse farthest-corner, #323C49 0%, #718299 65%) no-repeat scroll 0 0 transparent;

I have this code above and i j

4条回答
  •  别那么骄傲
    2021-02-05 08:26

    Well, as long as the rest of the gradient (after your set number of pixels) can be a fixed color, just use three color stops as follows (this e.g. stops at 30px - notice the last entry is identical to the second):

    background: linear-gradient(to bottom, rgba(90,90,90,0.75) 0%,rgba(0,0,0,0.75) 30px,rgba(0,0,0,0.75) 100%);
    

提交回复
热议问题