Error scaling image in chrome and safari

On my webpage I have a div with a border radius: 50%; inside this div I added an image, when it is hovering over that image, it scales to 1.2. this thing works correctly in mozilla, but when i get to chrome and safari, the image is scaled to overflow it than the circular div (border-radius: 50%) why this is happening. is there any way to solve this?

the code

HTML

<div class="work-round">
  <img src="images/latestwork_01.png">
</div>

CSS

.work-round {
    border: 5px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    margin: 10px auto;
    max-height: 250px;
    overflow: hidden;
    width: 250px;
}

.work-round img {
    background: none repeat scroll 0 0 #fff;
    height: 100%;
    min-height: 240px;
    transition: all 0.5s ease-out 0s;
    width: 350px;
}
.work-round img:hover {
    opacity: 0.9;
    transform: scale(1.2);
}

reproduced here

Hover screenshot enter image description here

+4
source share
3 answers

Solution found by nickspiel here: css3 transition to border animation in safari not working

: https://jsfiddle.net/KyleKatarn/s0bpp0ho/6/

.work-round {
    -webkit-mask-image: -webkit-radial-gradient(white, black);

Safari: https://jsfiddle.net/KyleKatarn/s0bpp0ho/7/

+2

( Chrome)

*{

    background:red;
}
.work-round {
    border: 5px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    margin: 10px auto;
    max-height:250px;
    overflow:hidden;
    width:250px;
    transition: all 2s linear;    
    -webkit-mask-image: -webkit-radial-gradient(circle, white, black);


}

.work-round img {
        background: none repeat scroll 0 0 #fff;
    height: 100%;
    min-height: 240px;
    transition: all 0.5s ease-out 0s;
    width: 350px;

    -webkit-border-radius: 500px;width:100%;height:100%;

}
.work-round img:hover {
    opacity: 0.9;
    -webkit-transform:scale(1.2);
}
+1

,

it chrome BUG .

, (: ) ( .work-round)

position:relative;
z-index:1;
+1

All Articles