css: 悬停放大

html:

<div class="imgBox">
    <img src="http://www.jq22.com/img/cs/500x500-1.png" alt="">
</div>

css:

.imgBox {
    width:200px;
    height:200px;
    overflow:hidden;
}
.imgBox img {
    width:200px;
    height:200px;
    transition:all .4s;
    -moz-transition:all .4s;
    -webkit-transition:all .4s;
    -o-transition:all .4s;
}
.imgBox img:hover {
    transform:scale(1.2);
}

 

posted @ 2020-06-12 12:56  Nyan  阅读(316)  评论(0编辑  收藏  举报