A Pen by James Barnett on CodePen.
Created
April 10, 2015 12:34
-
-
Save barnettjw/0b98fbe1ebcf6577dad9 to your computer and use it in GitHub Desktop.
Top Left Rounded Corner in CSS
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="box"> | |
<div class="triangle"> | |
<span>New</span> | |
</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
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