Created
December 16, 2011 04:49
-
-
Save Grawl/1484524 to your computer and use it in GitHub Desktop.
CSS triangle with border
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
/** | |
* CSS triangle with border | |
*/ | |
body { | |
padding: 10px 30px; | |
} | |
div { | |
background: white; | |
border: 1px solid #666666; | |
padding: 10px; | |
margin: 10px 0 0; | |
width: 200px; | |
position: relative; | |
text-align: center; | |
} | |
div::before { | |
content: ""; | |
display: block; | |
position: absolute; | |
left: 50%; | |
top: -6px; | |
margin-left: -5px; | |
-webkit-transform: rotate(45deg); | |
-moz-transform: rotate(45deg); | |
transform: rotate(45deg); | |
background: white; | |
border: inherit; | |
width: 10px; | |
height: 10px; | |
} | |
div::after { | |
content: ""; | |
display: block; | |
position: absolute; | |
left: 50%; | |
top: 0; | |
background: white; | |
width: 20px; | |
height: 10px; | |
margin-left: -10px; | |
} |
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>GrawlCore</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
{"page":"css","view":"split-vertical"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment