我有一个图像,它的背景颜色在悬停时改变。
它需要1秒来改变颜色,但一旦courser移出图像,它就会在没有任何效果的情况下变回来。
如何设置背景色淡出效果?
CSS:.latestTrack {
margin:80px 0 0 0 !important;
}
.latestTrack img {
float:right;
margin-right:50px !important;
}
.latestTrack img:hover
-webkit-transition: all 1s ease;
-moz-transition: all 1s ease;
-o-transition: all 1s ease;
-ms-transition: all 1s ease;
transition: all 1s ease;
background-color:#f7710f;
}
HTML: <img src="img/SocIco/soundcloud-large.png" />
你忘了缓出部分:
.latestTrack img {
float:right;
margin-right:50px !important;
-webkit-transition: all 1s ease-out;
-moz-transition: all 1s ease-out;
-o-transition: all 1s ease-out;
-ms-transition: all 1s ease-out;
transition: all 1s ease-out;
}