Created
November 5, 2012 04:10
-
-
Save Ricardo-Diaz/4015272 to your computer and use it in GitHub Desktop.
CSS: Box Shadow Curved top and bottom
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
effect and adds shadow to the top of the box and the bottom. Looks like center is lifted. | |
The HTML | |
<div class="box effect7"> | |
<h3>Effect 7</h3> | |
</div> | |
The CSS | |
.box h3{ | |
text-align:center; | |
position:relative; | |
top:80px; | |
} | |
.box { | |
width:70%; | |
height:200px; | |
background:#FFF; | |
margin:40px auto; | |
} | |
/*================================================== | |
* Effect 7 | |
* ===============================================*/ | |
.effect7 | |
{ | |
position:relative; | |
-webkit-box-shadow:0 1px 4px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset; | |
-moz-box-shadow:0 1px 4px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset; | |
box-shadow:0 1px 4px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset; | |
} | |
.effect7:before, .effect7:after | |
{ | |
content:""; | |
position:absolute; | |
z-index:-1; | |
-webkit-box-shadow:0 0 20px rgba(0,0,0,0.8); | |
-moz-box-shadow:0 0 20px rgba(0,0,0,0.8); | |
box-shadow:0 0 20px rgba(0,0,0,0.8); | |
top:0; | |
bottom:0; | |
left:10px; | |
right:10px; | |
-moz-border-radius:100px / 10px; | |
border-radius:100px / 10px; | |
} | |
.effect7:after | |
{ | |
right:10px; | |
left:auto; | |
-webkit-transform:skew(8deg) rotate(3deg); | |
-moz-transform:skew(8deg) rotate(3deg); | |
-ms-transform:skew(8deg) rotate(3deg); | |
-o-transform:skew(8deg) rotate(3deg); | |
transform:skew(8deg) rotate(3deg); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment