I tried to display a simple image, inside of a container with border-radius: 5px;. But there seem to be an outline of thin border at the corners (you'll need to look carefully at the below image). How can I avoid these corner borders ?
.cover {
margin: 1em;
padding: 1em;
}
.image-wrapper {
height: 15em;
width: 15em;
overflow: hidden;
background-color: black;
border-radius: 15px;
}
img {
height: 100%;
width: auto;
}
<div class="cover">
<div class="image-wrapper">
<img
src="https://images.pexels.com/photos/316466/pexels-photo-316466.jpeg"
/>
</div>
</div>
Yes, it goes away if I remove background-color: black;. But I need to retain the background-color and I also need img { height: 100%; width: auto; } to maintain the aspect ratio and to care of scenarios when the size of the image is too thin or too wide, etc.
Searching for other similar questions, I could only find questions/responses for Safari. I'm using Brave browser.
