I'm making carousel pagination, which should looks like circle with small circle inside. The problem is centring of inner circle, which is always just a little bit on the side.
I've tried a lot ways of centring via tranforms, margins, calc top & left etc..
div {
height: 13px;
width: 13px;
border: 1px solid black;
border-radius: 50%;
position: relative;
}
div::after {
content: "";
width: 8px;
height: 8px;
background-color: red;
position: absolute;
top: calc(50% - (8px / 2));
left: calc(50% - (8px / 2));
border-radius: 50%;
}
<div></div>
FIDDLE
I expect fully centered inner circle.
Make your pixels a even numbers to centering correctly like this:
div {
height: 14px;
width: 14px;
border: 1px solid black;
border-radius: 50%;
position: relative;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With