Created
April 4, 2013 22:40
-
-
Save skopp/5314992 to your computer and use it in GitHub Desktop.
Freakin Hexagon! A CodePen by skopp.
This file contains hidden or 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><h1>IT's a freaking hexagon!</h1></div><div><div id="hexagon"></div></div> |
This file contains hidden or 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
| /// big ups 2 http://css-tricks.com/examples/ShapesOfCSS | |
| /// |
This file contains hidden or 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
| #hexagon { | |
| width: 100px; | |
| height: 55px; | |
| background: red; | |
| position: relative; | |
| } | |
| #hexagon:before { | |
| content: ""; | |
| position: absolute; | |
| top: -25px; | |
| left: 0; | |
| width: 0; | |
| height: 0; | |
| border-left: 50px solid transparent; | |
| border-right: 50px solid transparent; | |
| border-bottom: 25px solid red; | |
| } | |
| #hexagon:after { | |
| content: ""; | |
| position: absolute; | |
| bottom: -25px; | |
| left: 0; | |
| width: 0; | |
| height: 0; | |
| border-left: 50px solid transparent; | |
| border-right: 50px solid transparent; | |
| border-top: 25px solid red; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment