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?
相关问题
- Views base64 encoded blob in HTML with PHP
- Is there a way to play audio on a mobile browser w
- HTML form is not sending $_POST values
- implementing html5 drag and drop photos with knock
- Adding a timeout to a render function in ReactJS
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:
Mozilla:
Webkit:
(Updated after changes to Webkit gradients)
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.
Although this is not an all-around sollution, it works on Safari/Webkit - so it's nice to know for someone who does mobile apps.
So, suppose you only address webkit, you've got this nice feature described here.
This also helps you when you can't fake the fade-out with some overlaid element. (for example, having an image on the background, instead of a solid color)
For the rest, go with the above.