我需要一種方法來製作帶有CSS3的縮放動畫,並使用border-radius
。但正如你可以看到下面,它不能很好地工作:CSS3縮放動畫帶邊框半徑
工作代碼:https://jsfiddle.net/n5owxmch/
CSS:
* {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
margin: 0;
padding: 0;
}
.item {
position: relative;
border-radius: 10px;
border: 1px solid #333;
margin: 2%;
overflow: hidden;
width: 540px;
}
.item img {
max-width: 100%;
-moz-transition: all 21s;
-webkit-transition: all 21s;
transition: all 21s;
}
.item:hover img {
-moz-transform: scale(1.1);
-webkit-transform: scale(1.1);
transform: scale(1.1);
}
HTML:
<div class="item">
<img src="https://scontent.cdninstagram.com/t51.2885-15/s600x600/e35/17661731_634657496725091_8999479055321399296_n.jpg" alt="pepsi" width="540" height="548">
<div class="item-overlay top"></div>
</div>
有沒有辦法解決這個問題?
以何種方式它不能很好地工作? – LGSon
你的例子對我很好,什麼工作不好? –
@LGSon在動畫過程中,邊框不像上圖和jsFiddle中所示的那樣是圓形的。 – xRobot