從這裏https://codepen.io/dragoeco/pen/ibrzKCSS背景放大效應
有效使用以下縮放需要得到一個背景圖像淡入與變焦效果懸停喜歡這裏的一個http://fantasy.co/work保持前景標誌相同的一些援助。
.image-box{
width:300px;
overflow:hidden;
}
.image {
\t width:300px;
height:200px;
\t background: url("http://lorempixel.com/300/200");
\t background-position:center;
\t transition: all 1s ease;
-moz-transition: all 1s ease;
-ms-transition: all 1s ease;
-webkit-transition: all 1s ease;
-o-transition: all 1s ease;
}
.image:hover {
transform: scale(1.5);
-moz-transform: scale(1.5);
-webkit-transform: scale(1.5);
-o-transform: scale(1.5);
-ms-transform: scale(1.5); /* IE 9 */
-ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=1.5, M12=0, M21=0, M22=1.5, SizingMethod='auto expand')"; /* IE8 */
filter: progid:DXImageTransform.Microsoft.Matrix(M11=1.5, M12=0, M21=0, M22=1.5, SizingMethod='auto expand'); /* IE6 and 7 */
}
<div class="image-box">
<div class="image">
</div>
</div>
這有助於很多,是正確的!謝謝一堆! @kukkuz – user1749105