Created
January 4, 2012 23:03
-
-
Save LeaVerou/1562718 to your computer and use it in GitHub Desktop.
box-shadow vs drop-shadow
This file contains 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
/** | |
* 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; | |
} |
This file contains 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="drop-shadow">I ♥ SVG filters!</div> | |
<div class="box-shadow">I ♥ CSS3 box-shadow!</div> |
This file contains 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
{"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