I'm trying to make a div with overflow hidden and rounded corners, this is my only option because i'm using wkhtmltopdf for rendering resume's people, so when they put their image or profile picture, the container makes bigger or doesn't work because pictures are not with the same sizes, so i'm put the <img> tag into a div for make this one for only one size and if the picture is bigger, this one going behind the rounded div.
Could anybody bring me some idea how can i make it?
This is the structure:
HTML
<div class="main">
<div class="middle">
<img src="#">
</div>
</div>
CSS
.main {
width: 125px;
height: 125px;
position: relative;
}
.middle {
width: 100%;
height: 100%;
position: absolute;
overflow: hidden;
border-radius: 50%;
}
.middle img{
max-width: 100%;
max-height: 100%;
height: auto;
width: auto;
}