开发者

CSS3, how to make my Gradient WebKit Background Transparent?

开发者 https://www.devze.com 2023-01-11 03:38 出处:网络
I have the following line of CSS: background: -webkit-gradient(linear, left top, left bottom, from(#243d63), to(#1a2638));

I have the following line of CSS:

background: -webkit-gradient(linear, left top, left bottom, from(#243d63), to(#1a2638));

How can I make the background 开发者_运维百科transparent, ie an opacity of .9, so the user can see what's under the div that has this style? Just for WebKit only concern...

Thanks


Use rgba

    background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(rgba(255,52,21,0.2)), to(#000), color-stop(.6,#000));

rgba syntax is as so: rgba(redInDecimal,greenInDecimal,blueInDecimal,alphaFrom0To1);

http://jsfiddle.net/PxnXn/1/

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号