I’m trying to draw a custom shape with rounded corners using CSS. Below is an image of what I have so far, but as you can see the rounded corners aren’t completely working.
I’ve tried using SVGs but haven’t been able to get that work work yet. Here is the code for the shape below:
.custom-shape {
clip-path: polygon(0 0, 100% 0, 75% 100%, 0 100%);
border-radius: 10px;
}
2
Answers
You could use two rectangle with a css skew on the second to achieve it, i’ve made the two rectangle with different color so that you can understand but if you put them both like this you can create your shape.
Here is my code :
HTML :
CSS :
If you want to change the angle of the right side just play with the skew value.
You need to define the exact shape that you need. And if you would like rounded corners, you need to draw them. You can use any SVG or text editor to draw a shape. In this example I use the shape
path()
because I have been drawing a path in SvgPathEditor.