Skip to content

Instantly share code, notes, and snippets.

@exarcheia-web
Created January 27, 2014 10:25
Show Gist options
  • Save exarcheia-web/8646280 to your computer and use it in GitHub Desktop.
Save exarcheia-web/8646280 to your computer and use it in GitHub Desktop.
Paper Stack with pseudo elements
/**
* Paper Stack with pseudo elements
*/
*, *:before, *:after {
-webkit-box-sizing: border-box;
}
.paper {
width: 280px;
height: 300px;
box-shadow: 0 0 8px #9e9e9e;
margin: 190px auto 0;
background: white;
position: relative;
padding: 40px;
}
.paper:after {
content: "";
display: block;
position: absolute;
top: -5px;
left: 0;
z-index: -1;
width: inherit;
height: inherit;
box-shadow: inherit;
background: white;
transform: rotateZ(12deg);
}
.paper:before {
content: "";
display: block;
position: absolute;
top: 5px;
left: 0;
z-index: -1;
width: inherit;
height: inherit;
box-shadow: inherit;
background: white;
transform: rotateZ(-8deg);
}
/* cosmetic stuff */
.paper p {
font-family: Georgia, serif;
font-style: italic;
text-align: center;
font-size: 2em;
position: absolute;
left: 50%;
top: 40%;
transform: translate(-50%, -50%);
}
<div class="paper">
<p>This is a single div</p>
</div>
// alert('Hello world!');
{"view":"split-vertical","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