I was wondering if is there's a way to do the following rectangle's borders with border-radius or any other property, take a look at what i need:
And so far this is what I have got using border-radius
:
The rectangle at top was created with Wix, the other one is made with CSS and HTML. As you can see the borders as so different.
Is there a way to accomplish it?
This is possible as you can define each corner within the border radius value, which will then give you the shape you want, see below for a simple example and you can read more on how this works on https://www.w3schools.com/cssref/css3_pr_border-radius.asp
#rcorners { border-radius: 4em / 2em; background: #73AD21; padding: 20px; width: 200px; height: 150px; }
<div id="rcorners">Rounded corners!</div>
Try something like this, you want border-radius: x/y
where x is the higher value for the corner your looking for
.test { margin: auto; width: 400px; height: 100px; background-color: blue; border-radius: 30%/10%; }
<div class="test"> </div>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.