1、css父元素hover悬停 子元素缩放
.col-lg-4 img{
cursor: pointer;
transition: all 1s ease;
}
.col-lg-4:hover img{
transform: scale(1.2);
opacity: 0.5;
}
.col-lg-4:hover div:nth-child(2){
bottom: 8px;
}
.col-lg-4 div:nth-child(2){
cursor: pointer;
transition: all 1s ease;
}
2、css鼠标悬停图片旋转
.dingzhi_bottom img:hover{
transform:rotate(360deg);
-ms-transform:rotate(360deg); /* IE 9 */
-moz-transform:rotate(360deg); /* Firefox */
-webkit-transform:rotate(360deg); /* Safari 和 Chrome */
-o-transform:rotate(360deg);
transition: all 0.6s; /* Opera */
}
3、css鼠标悬停图片放大
div{
width: 300px;
height: 300px;
border: #000 solid 1px;
margin: 50px auto;
overflow: hidden;
}
div img{
cursor: pointer;
transition: all 0.6s;
}
div img:hover{
transform: scale(1.4);
}
4、css悬停,背景颜色从左至右滑动
<style type="text/css">
.viewcontent__action{
width: 100px;
height: 50px;
position: relative;
line-height: 50px;
text-align: center;
}
.viewcontent__action a::before {
position: absolute;
top: 0;
left: 0;
width: 0;
height: 100%;
background: #000;
transition: 0.3s;
content: "";
z-index: -1;
}
.viewcontent__action a:hover::before {
width: 100%;
transition: 0.3s;
color: #fff;
}
</style>
<div class="viewcontent__action"><a href="">联系我们</a></div>