Created
September 9, 2012 21:17
-
-
Save chrisnager/3687361 to your computer and use it in GitHub Desktop.
Box sizing for pseudo elements
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=☃>☃</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
// Box sizing for pseudo elements | |
// by @chrisnager |
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
/* Base styles | |
------------------------------ */ | |
*, | |
:before, | |
:after { | |
-webkit-box-sizing: border-box; | |
-moz-box-sizing: border-box; | |
box-sizing: border-box; | |
} | |
/* ☃ | |
------------------------------ */ | |
.☃ { | |
margin: 0 auto; | |
padding: 8px; | |
font-size: 2em; | |
text-align: center; | |
color: indianred; | |
background: lightblue; | |
} | |
.☃:before, | |
.☃:after { | |
content: "☃"; | |
width: 100%; | |
border: 8px solid; | |
padding: 8px; | |
display: block; | |
background: seashell; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment