作者:手机用户2502923697 | 来源:互联网 | 2023-05-18 19:17
Isthereawaytocreatagradientwithastopnpixelsfromthebottomedgeoftheelement?是否有一种方
Is there a way to creat a gradient with a stop n pixels from the bottom edge of the element?
是否有一种方法可以从元素的底部边缘创建一个停止n个像素的渐变?
For example with Moz/Firefox it would look like:
例如,对于Moz/Firefox,它会是:
-moz-linear-gradient(center bottom , #f00 2%, #d00 31px)
- mozl -linear-gradient(center bottom, #f00 2%, #d00 31px)
It should also be noted that this gradient has a companion gradient to do the same thing to the very top of the box. So really the css looks like this for FF and i need to reproduce for webkit:
还应该注意的是,这个渐变有一个相伴的渐变,可以对框的最上面做同样的事情。所以css对于FF是这样的我需要在webkit中复制
background-image:
-moz-linear-gradient(center top , rgba(255,0,0,0.75) 2%, rgba(255,0,0,0) 31px),
-moz-linear-gradient(center bottom , rgba(255,0,0,0.75) 2%, rgba(255,0,0,0) 31px);
4 个解决方案