Skip to content

Instantly share code, notes, and snippets.

@LeaVerou
Created January 4, 2012 23:03
Show Gist options
  • Save LeaVerou/1562718 to your computer and use it in GitHub Desktop.
Save LeaVerou/1562718 to your computer and use it in GitHub Desktop.
box-shadow vs drop-shadow
/**
* box-shadow vs drop-shadow
* Webkit-only at the moment (Chrome Canary or Webkit nightlies)
*/
div {
position: relative;
width: 150px;
padding: 20px;
border: 5px dotted;
border-radius: 20px;
margin: 60px;
color: #f06;
font: bold 150% sans-serif;
}
div.drop-shadow {
-webkit-filter: drop-shadow(3px 3px 5px gray);
}
div.box-shadow {
box-shadow: 3px 3px 5px gray;
}
div:after {
content: '';
position: absolute;
right: -40px;
top: 25px;
border: 20px solid transparent;
border-left-color: #f06;
}
<div class="drop-shadow">I &#x2665; SVG filters!</div>
<div class="box-shadow">I &#x2665; CSS3 box-shadow!</div>
{"view":"split-vertical","prefixfree":"1","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment