Skip to content

Instantly share code, notes, and snippets.

@jrob00
Created February 24, 2012 19:16
Show Gist options
  • Save jrob00/1903077 to your computer and use it in GitHub Desktop.
Save jrob00/1903077 to your computer and use it in GitHub Desktop.
Box Shadows
/**
* Box Shadows
*/
/* basic body styling - not neccessary for this class */
body {
margin: 60px 20px;
font-family: Helvetica, Arial, sans-serif;
color: #454545;
background-color: #f6f6f6;
font-size: 12px;
}
.inner {
height: auto;
width: 400px;
margin: 0 auto;
padding: 40px;
border-radius: 8px;
background: #707070;
color: #fff;
font-size: 12px;
/* top, right, left */
box-shadow: inset 8px 8px 14px -8px rgba(0,0,0,1),
inset -8px 8px 14px -8px rgba(0,0,0,1);
/* left, right */
box-shadow: inset 8px 0px 14px -8px rgba(0,0,0,1), inset -8px 0px 14px -8px rgba(0,0,0,1);
/* right, left, bottom */
box-shadow: inset 8px -8px 14px -8px rgba(0,0,0,1),
inset -8px -8px 14px -8px rgba(0,0,0,1);
}
.empty {
/*top shadow*/
box-shadow: inset 0px 8px 14px -8px rgba(0,0,0,1);
/*bottom shadow*/
box-shadow: inset 0px -8px 14px -8px rgba(0,0,0,1);
/*left shadow*/
box-shadow: inset 8px 0px 14px -8px rgba(0,0,0,1);
/*right shadow*/
box-shadow: inset 8px 0px 14px -8px rgba(0,0,0,1);
/*top & bottom shadow*/
box-shadow: inset 0px 8px 14px -8px rgba(0,0,0,1), inset 0px -8px 14px -8px rgba(0,0,0,1);
/*left & right shadow*/
box-shadow: inset 8px 0px 14px -8px rgba(0,0,0,1), inset -8px 0px 14px -8px rgba(0,0,0,1);
/*top & left shadow*/
box-shadow: inset 8px 8px 14px -8px rgba(0,0,0,1);
/*bottom & right shadow*/
box-shadow: inset -8px -8px 14px -8px rgba(0,0,0,1);
}
<div class="inner">
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>
</div>
{"view":"split","seethrough":"","prefixfree":"1","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment