Reputation: 767
I don't meant any fade in/out animation. I'd like to know if there is any crazy futuristic CSS property, technics or JS plugin to achieve this effect:
Thanks in advance!
Upvotes: 1
Views: 2444
Reputation: 3063
Yes, you can set an object with the property:
background: linear-gradient(rgba(255,255,255,1),rgba(255,255,255,0))
Fourth argument in rgba
is the opacity, which will help creating that fading effect while using linear-gradient
.
Upvotes: 0
Reputation: 10145
For the entire content, I think the best option would be to use the mask-image
property with a CSS transition:
-webkit-mask-image: -webkit-gradient(linear, left top, left bottom, from(rgba(0,0,0,1)), to(rgba(0,0,0,0)));
https://developer.mozilla.org/en-US/docs/Web/CSS/mask-image
https://developer.mozilla.org/en-US/docs/Web/CSS/transition
Upvotes: 2