Last active
August 29, 2015 14:13
-
-
Save BenKalsky/d552bb7937c28fb92ca3 to your computer and use it in GitHub Desktop.
How to make 3-corner-rounded triangle in CSS (SO)
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
.triangle { | |
position: relative; | |
background-color: orange; | |
text-align: left; | |
} | |
.triangle:before, | |
.triangle:after { | |
content: ''; | |
position: absolute; | |
background-color: inherit; | |
} | |
.triangle, | |
.triangle:before, | |
.triangle:after { | |
width: 16px; | |
height: 16px; | |
border-top-right-radius: 40%; | |
} | |
.triangle { | |
transform: rotate(-90deg) skewX(-30deg) scale(1,.866); | |
} | |
.triangle:before { | |
transform: rotate(-135deg) skewX(-45deg) scale(1.414,.707) translate(0,-50%); | |
} | |
.triangle:after { | |
transform: rotate(135deg) skewY(-45deg) scale(.707,1.414) translate(50%); | |
} |
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 class='triangle'></div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment