更新时间:2022-10-19 14:05:46
只需添加背景颜色
,与您的边框颜色相同,并且已修复。
请参阅 jsFiddle
I have an image with a border radius of 50% and a 3px border around it. My problem is when the border radius is given, there is a 1px gap between the image and the border.
Issue is demonstrated in the below image.
And the css I'm using,
img {
border: 3px solid #4CB7AC;
height: 46px;
width: 46px;
border-radius:50%;
}
Note that
<img>
to get the image. Setting it as a background image is ruled out.Is there a way to remove that gap?
EDIT JS Fiddle link
Just Add Background color
same as your Border color and it's fixed.
See jsFiddle