I am trying to make a 50% rounded img inside a simple div. I have tried 2 ways to do it, but obviously neither has worked for me. If it makes something clear, the image, that I'm getting is square
/*HTML*/
<div class="img-container"></div>
/*CSS*/
.img-container {
background: url("../../../../../assets/img/user-photo.svg") no-repeat center top / cover;
height: 125px;
width: 125px;
border-radius: 50%;
}
/*HTML*/
<div class="img-container">
<img src="path_to_img" alt="User photo">
</div>
/*CSS*/
.img-container {
width: 125px;
height: 125px;
img {
width: 100%;
height: 100%;
border-radius: 50%;
}
}
I am getting it quite cropped in the bottom. Are there any other solutions or what I am doing wrong in 2 examples above? Any help appreciate.