Reputation: 15
I want to make a trapezoid with border radius like this picture. Is it possible?
I tried this code but it does not work
background: #BE1E2D;
width: 130px;
height: 75px;
-webkit-transform: skew(20deg);
-moz-transform: skew(20deg);
-o-transform: skew(20deg);
transform: skew(20deg);
Upvotes: 0
Views: 2371
Reputation: 36662
I don't see how you could do this with border-radius
(or why you would want to)
You can do it with a simple skew:
#shape {
width: 150px;
height: 50px;
-webkit-transform: skew(-25deg);
-moz-transform: skew(-25deg);
-o-transform: skew(-25deg);
background: darkred;
}
Upvotes: 0
Reputation: 6863
Try this. Doesn't use border-radius
though.
.trapezoid{
width:100px;
height:100px;
border:1px solid #000;
background:yellow;
transform: skew(-20deg);
-o-transform: skew(-20deg);
-moz-transform: skew(-20deg);
-webkit-transform: skew(-20deg);
}
Upvotes: 0
Reputation: 15609
Visit this website to look at how a lot of shapes are done.
For this shape though (as it is on the website), you need this:
#parallelogram {
width: 150px;
height: 100px;
-webkit-transform: skew(-20deg);
-moz-transform: skew(-20deg);
-o-transform: skew(-20deg);
background: red;
}
Upvotes: 1