Although the border-radius amount of the following 2 boxes is the same, it shows different results. What is the reason of this? And how can we set it to look the same in every box. Do we have to do mathematical operations according to the size of the box? (I'm talking about why box 2 is less round.)
I know it's an optical illusion but I want it to look the same given the size of the box.
* {
margin: 1rem;
}
.box {
width: 10rem;
height: 5rem;
background-color: black;
border-radius: 3rem;
}
.box2 {
width: 20rem;
height: 10rem;
background-color: black;
border-radius: 3rem;
}
<div class="box"></div>
<div class="box2"></div>
The border-radius gets jagged when I do it with percentages.
* {
margin: 1rem;
}
.box {
width: 10rem;
height: 5rem;
background-color: black;
border-radius: 20%;
}
.box2 {
width: 20rem;
height: 10rem;
background-color: black;
border-radius: 20%;
}
<div class="box"></div>
<div class="box2"></div>