我有一个关于我的css悬停效果的问题。css悬停在转换
这是我的DEMO从codepen
页面。
问题是悬停在图像上。如果你点击我的演示页面,那么你会发现我的脚本中出现了什么问题。
当你用鼠标将鼠标悬停在图像上时,第一个图像是可以的,但是当你移动鼠标时,另一个图像的渐变颜色向左移动。
有谁知道解决方案?
这是为图像悬停过渡和渐变颜色我的CSS代码:
.abo_im {
float:left;
width:170px;
height:150px;
overflow:hidden;
-webkit-transition: all .3s ;
-moz-transition: all .3s ;
-ms-transition: all .3s ;
-o-transition: all .3s ;
transition: all .3s ;
}
.abo_im img.height {
width: 100%;
height:auto;
}
.abo_im img {
width:100%;
}
.abo_im:hover {
width:120%;
margin: 0 0 0 -10%;
-moz-transition: all .3s ;
-ms-transition: all .3s ;
-o-transition: all .3s ;
transition: all .3s ;
}
.gradient_c {
position:absolute;
width:170px;
height:150px;
z-index:1;
background: -moz-linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.8));
background: -webkit-linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.8));
background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.8));
}
只是一个提示:这是没用的定义都在正常和'了'transition'属性:hover'选择......只留下第一个,和从':hover'移除属性 – LcSalazar 2014-09-26 15:39:26
@LcSalazar谢谢 – innovation 2014-09-26 15:46:14