I want to make only one rounded corner for a triangle but I'm unable to make it.
Here is my code:
.arrow-left {
width: 0;
height: 0;
border-top: 80px solid transparent;
border-bottom: 80px solid transparent;
border-right: 80px solid blue;
}
<div class="arrow-left"></div>
I need the corner pointing left to be rounded as shown in this image :
to your code to add this
I know this is a little hacky, but I don't think there is an easy way to do this with a single class.
All I've done is rotated a box 45 degrees with
border-radius:10px
and then contained it in another div with width set to the desired width of your arrow andoverflow:hidden
so that everything that spills over is invisible.http://jsfiddle.net/9D3Zn/5/
You can try this and modify according to your needs.
http://jsfiddle.net/K44mE/947/
You can make a responsive triangle with one rounded corner with at least 2 approaches :
With CSS:
With one
div
and a pseudo element and:overflow:hidden;
Note that you need to add the vendor prefixes to the transform and transform-origin properties (more info on canIuse)
With inline SVG:
This example uses one path element for the triangle with a bezier curve command for the rounded corner (
Q0 5 0.8 4.2
in thed
attribute):