Skip to content

Instantly share code, notes, and snippets.

@cahnory
Created December 5, 2012 09:06
Show Gist options
  • Save cahnory/4214076 to your computer and use it in GitHub Desktop.
Save cahnory/4214076 to your computer and use it in GitHub Desktop.
CSS Perspective shadow
/**
* CSS Perspective shadow
*/
.wrapper {
margin: 2em auto;
max-width: 960px;
}
.box {
background: #444;
color: #FFF;
height: 320px;
position: relative;
}
.box:after {
bottom: -100%;
content: '\00A0';
display: block;
left: -64px;
position: absolute;
right: -64px;
top: 100%;
z-index: -1;
margin-top: -10000px;
background: black;
box-shadow: inset 0 0 64px 64px #ffffff;
transform: translateY(10000px) perspective(960px) rotateX(-96.25deg);
transform-origin: 50% 16px;
}
<div class="wrapper">
<div class="box"></div>
</div>
// alert('Hello world!');
{"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