作者:热血洒在青春中 | 来源:互联网 | 2023-05-18 11:04
IwouldliketoknowifitwouldbepossibletoreplicatetheeffectlikethebottomoftheTopTwee
I would like to know if it would be possible to replicate the effect like the bottom of the Top Tweets list with pure CSS?
我想知道是否可以使用纯CSS复制顶级推文列表底部的效果?
http://www.twitter.com
2 个解决方案
20
Yes you can! Taking advantage of RGBa colors and CSS3 gradients, we can apply the following styles to an element and have a fading semi-transparent background:
是的你可以!利用RGBa颜色和CSS3渐变,我们可以将以下样式应用于元素并具有淡化的半透明背景:
Mozilla:
background: -moz-linear-gradient(top, rgba(255,255,255,0), rgba(255,255,255, 1));
Webkit:
background: -webkit-linear-gradient(top, rgba(255,255,255,0), rgba(255,255,255, 1));
(Updated after changes to Webkit gradients)
(更改Webkit渐变后更新)
Sadly, this only works in Firefox 3.6+, Safari, and Chrome. If you need the effect in IE or older versions of Firefox, then you'd be better off using the semi-transparent PNG like Twitter does.
遗憾的是,这仅适用于Firefox 3.6 +,Safari和Chrome。如果您需要在IE或旧版本的Firefox中使用效果,那么您最好使用像Twitter这样的半透明PNG。