I have a circle with some <div> in it.
I want to hide overflow of this <div> using overflow:hidden property.
This is the result:
As you can see, div is not hidden at all. However, after removing position:absolute from inner <div>, it looks like this:
Now, the <div> is properly cropped, but the outer <div> is now an ellipse rather than a circle.
How can I have a circle with properly cropped inner <div>?
My code:
.button-circle {
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
-ms-border-radius: 50%;
-o-border-radius: 50%;
border-radius: 50%;
overflow: hidden;
width: 100%;
padding-bottom: 100%;
background-image: url(http://placekitten.com/200/300);
background-size: cover;
}
.button-circle div {
width: 100%;
position: absolute;
text-align: center;
background: rgba(0, 0, 0, 0.7);
}
<div class="button-circle">
<div>
<h3>Click me!</h3>
</div>
</div>

