Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 1st, 2012  |  syntax: None  |  size: 0.97 KB  |  hits: 18  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How to apply a fade away effect (not animation) across all the content of a div?
  2. .fadeDiv {
  3.   position:absolute;
  4.   width:100%;
  5.   bottom:0;
  6.   background:url(fadeImg.png) repeat-x 0 0;
  7. }
  8.        
  9. div.Overlay {
  10.   width:100%; height:100%;
  11.   z-index:10;
  12.   top:0; left:0;
  13.   position:fixed; }
  14.  
  15. <body>
  16.   <div class="Overlay Gradient"></div>
  17.   Any Content You like here...
  18. </body>
  19.        
  20. .Gradient{
  21. /* webkit example */
  22. background-image: -webkit-gradient(
  23.   linear, left top, left bottom, from(rgba(50,50,50,0.8)),
  24.   to(rgba(80,80,80,0.2)), color-stop(.5,#333333)
  25. );
  26. /* mozilla example - FF3.6+ */
  27. background-image: -moz-linear-gradient(
  28.   rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 95%
  29. );
  30. /* approximately a 33% opacity on blue */
  31. filter: progid:DXImageTransform.Microsoft.gradient(
  32.   startColorstr=#550000FF, endColorstr=#550000FF
  33. );
  34.  
  35. /* IE8 uses -ms-filter for whatever reason... */
  36. -ms-filter: progid:DXImageTransform.Microsoft.gradient(
  37.   startColorstr=#550000FF, endColorstr=#550000FF
  38. );
  39. }