As we know does overflow: hidden
in combination with border-radius
not work in all browser as it should — namely Safari and Opera have problems cutting the rounded corners off contained images.
Example HTML:
<a class="circle" href="#">
<img src="http://placekitten.com/300/300" alt="kitten" />
</a>
and corresponding CSS:
.circle {
-webkit-border-radius: 100px;
-moz-border-radius: 100px;
border-radius: 100px;
height: 120px;
overflow: hidden;
width: 120px;
}
check this jsfiddle
I do have a fall-back for Safari and Opera using background-images, but I only want to use it in case overflow
isn't working well. Now, I don't want to simply use browser detection for known reasons, but I want to feature detect the ability to cut off the corners the right way. Normally I would check like this:
if('overflow' in document.body.style){
// overflow
} else {
// no overflow
}
But this will not help this time... So, is there any way to check it correctly?