Last active
August 29, 2015 14:13
-
-
Save benweiser/ac17eea147b9bfc2fbf2 to your computer and use it in GitHub Desktop.
CSS Triangles
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 { | |
| position:relative; /* Position must be relative to absolutely position :after */ | |
| background:#333; /* Background color to show effect */ | |
| } | |
| div:after{ | |
| content:''; /* Required to display content */ | |
| position: absolute; /* Sets the position absolute to the top div */ | |
| top: 0; | |
| left: 50%; | |
| margin-left: -50px; /* Set margin equal to border px */ | |
| width: 0; | |
| z-index:1; | |
| height: 0; | |
| border-top: solid 50px #fff; /* Creates the notch */ | |
| border-left: solid 50px transparent; /* Creates triangle effect */ | |
| border-right: solid 50px transparent; /* Creates triangle effect */ | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment