Skip to content

Instantly share code, notes, and snippets.

@barnettjw
Created April 10, 2015 12:34
Show Gist options
  • Save barnettjw/0b98fbe1ebcf6577dad9 to your computer and use it in GitHub Desktop.
Save barnettjw/0b98fbe1ebcf6577dad9 to your computer and use it in GitHub Desktop.
Top Left Rounded Corner in CSS
<div class="box">
<div class="triangle">
<span>New</span>
</div>
</div>
body { margin: 20px; }
.triangle {
width: 0; height: 0;
border-top: 55px solid #ea6c6c;
border-right: 55px solid transparent;
}
.box {
position: relative;
width: 315px;
height: 160px;
background: #f0f7fa;
border-radius: 10px;
overflow: hidden;
}
.triangle > span {
position: absolute; top: 7px;
transform: rotate(-45deg);
font-size: 18px; color: white;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment