这个问题可能很明显,但我是 css 新手。
我正在动画一个形状,所以当你悬停它时,它会伸展。我已经通过一个很好的轻松过渡完成了悬停,但是当您离开鼠标时,过渡不起作用。有没有办法让它在悬停时刻也发生?
.shape1{
position: absolute;
background:red
top:512px;
width:180px;
height:140px;
}
.shape1:hover {
height: 160px;
top:492px;
transition: 0.2s ease;
}
Run Code Online (Sandbox Code Playgroud)