Skip to content

Instantly share code, notes, and snippets.

@cedricziel
Created October 5, 2013 13:49
Show Gist options
  • Save cedricziel/6841167 to your computer and use it in GitHub Desktop.
Save cedricziel/6841167 to your computer and use it in GitHub Desktop.
How to make 3-corner-rounded triangle in CSS (SO)
/**
* How to make 3-corner-rounded triangle in CSS (SO)
* http://stackoverflow.com/q/14446677/1397351
*/
.triangle,
.triangle:before {
width: 10em;
height: 10em;
position: relative;
background: orange;
margin: 30% auto 0;
}
.triangle:before {
content: '';
position: absolute;
margin: 0;
}
.triangle {
border-top-right-radius: 20%;
transform: rotate(-60deg) skewX(-30deg) scale(1,.866);
}
.triangle:before {
transform: rotate(-135deg) skewX(-45deg) scale(1.414,.707) translate(0,-50%);
}
<!-- content to be placed inside <body>…</body> -->
<div class='triangle'></div>
// alert('Hello world!');
{"view":"split-vertical","fontsize":"80","seethrough":"","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment