<分区>
我正在使用 CSS 实现漂亮的溢出效果。
因此,如果我将鼠标悬停在一张图片上,它会使用以下代码淡入另一张图片:
#image{
margin: 0 auto;
width: 100%;
background-position: center;
background-repeat: no-repeat;
height: 400px;
background-image: url('xerath.png');
-o-transition:color .1s ease-out, background 1s ease-in;
-ms-transition:color .1s ease-out, background 1s ease-in;
-moz-transition:color .1s ease-out, background 1s ease-in;
-webkit-transition:color .1s ease-out, background 1s ease-in;
/* ...and now override with proper CSS property */
transition:color .1s ease-out, background 1s ease-in;
}
#image:hover{
background-image: url('riven.png');
}
但现在如果我将鼠标悬停在图像上它会改变,当我将鼠标移开时图像会变回来,我不希望它变回来。
我该如何解决这个问题?