Created
July 6, 2012 14:53
-
-
Save rupert-ong/3060627 to your computer and use it in GitHub Desktop.
CSS3: Angled Drop Shadows
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
div { | |
background: rgba(255,255,255,1); | |
margin: 0 auto; | |
width: 200px; | |
padding: 100px; | |
text-align: center; | |
position: relative; | |
} | |
.shadow::before, .shadow::after { | |
content: ""; | |
z-index:-1; | |
position: absolute; | |
width: 50%; | |
height: 30px; | |
bottom: 10px; | |
box-shadow: 0 10px 14px rgba(0,0,0,0.75); | |
-webkit-transform: skew(-4deg) rotate(-4deg); | |
-moz-transform: skew(-4deg) rotate(-4deg); | |
transform: skew(-4deg) rotate(-4deg); | |
} | |
.shadow::before { | |
left: 12px; | |
} | |
.shadow::after { | |
-webkit-transform: skew(4deg) rotate(4deg); | |
-moz-transform: skew(4deg) rotate(4deg); | |
transform: skew(4deg) rotate(4deg); | |
right: 12px; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="shadow">Hello World!</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment