
Untitled
By: a guest on
May 1st, 2012 | syntax:
None | size: 0.97 KB | hits: 18 | expires: Never
How to apply a fade away effect (not animation) across all the content of a div?
.fadeDiv {
position:absolute;
width:100%;
bottom:0;
background:url(fadeImg.png) repeat-x 0 0;
}
div.Overlay {
width:100%; height:100%;
z-index:10;
top:0; left:0;
position:fixed; }
<body>
<div class="Overlay Gradient"></div>
Any Content You like here...
</body>
.Gradient{
/* webkit example */
background-image: -webkit-gradient(
linear, left top, left bottom, from(rgba(50,50,50,0.8)),
to(rgba(80,80,80,0.2)), color-stop(.5,#333333)
);
/* mozilla example - FF3.6+ */
background-image: -moz-linear-gradient(
rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 95%
);
/* approximately a 33% opacity on blue */
filter: progid:DXImageTransform.Microsoft.gradient(
startColorstr=#550000FF, endColorstr=#550000FF
);
/* IE8 uses -ms-filter for whatever reason... */
-ms-filter: progid:DXImageTransform.Microsoft.gradient(
startColorstr=#550000FF, endColorstr=#550000FF
);
}