Skip to content

Instantly share code, notes, and snippets.

@timrwood
Created June 26, 2012 01:11
Show Gist options
  • Save timrwood/2992441 to your computer and use it in GitHub Desktop.
Save timrwood/2992441 to your computer and use it in GitHub Desktop.
Scrolling shadows by @kizmarh and @LeaVerou
/**
* Scrolling shadows by @kizmarh and @leaverou
* Only works in browsers supporting background-attachment: local; & CSS gradients
* Degrades gracefully
*/
html {
background: white;
font: 120% sans-serif;
}
body {
position:absolute;
width: 100%;
height: 100%;
}
div {
position:absolute;
top:0;
left:50%;
margin-left:-10%;
width:20%;
height:200px;
background:#000;
}
.a {
-webkit-transform:translate3d(-20%, 0, -100%);
<div class="a"></div>
<div class="b"></div>
<div class="c"></div>
<div class="d"></div>
<div class="e"></div>
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment