I have a rectangular image with dimensions of 300px by 300px.
To display this image within a circle, I have created the following CSS code:
img {
width: 300px;
height: 300px;
background-color: white;
border-radius: 50%;
border: 2px solid black;
}
The problem I am facing is that the image doesn't fit perfectly inside the circular frame. It appears too large because parts of the image are being cut off due to the circular shape. One solution could be to use a smaller image size. However, resizing an image to 200px by 200px might distort it since the circle is larger than the image itself, causing it to stretch.
Do you have any suggestions on how to resolve this issue?
Below is the original picture I am working with:
https://i.sstatic.net/oWAqE.png
And here is the same picture displayed within a circle: