2016-06-21 80 views

回答

-1

嘗試添加一個新的元素,然後添加背景到該元素
添加溢出:隱藏父元素
在懸停規模的子元素

<div class="parent"> 
    <div class="child"> 
    </div> 
</div> 

.child { height:400px;width:200px;background:url....;transition:0.5s} 
.parent { overflow:hidden;} 
.parent:hover .child { transform:scale(1.5)} 

或者你可以使用一個僞元素,如:前

.parent { overflow:hidden;} 
.parent:before { width:100%;height:100%;content:"";position:absolute;top:0;background:url....;transition:0.5s } 
.parent:hover:before { transform:scale(1.5)} 

這裏有一個jsfiddle與第二液
第一解決方案工作爲好。你選擇:)