我用关键帧制作了一个 css3 动画。但我有一个问题。这是我的代码:
a[title*="in je favorieten"]:hover {
-moz-animation-duration: 1s;
-webkit-animation-duration: 1s;
-moz-animation-name: slidein;
-webkit-animation-name: slidein;
-moz-animation-iteration-count: 3;
-webkit-animation-iteration-count: 3;
-moz-animation-direction: alternate;
-webkit-animation-direction: alternate;
}
@-moz-keyframes slidein {
from {
width: 25px;
}
to {
width: 80px;
}
}
@-webkit-keyframes slidein {
from {
width: 25px;
}
to {
width: 80px;
}
}
问题是。当我将鼠标悬停在 a 元素上时。a 元素必须设置为宽度 80。当我悬停时。比 a 元素必须返回 25 宽度。但现在,我悬停,他做动画。然后他回到 25 岁。我该如何解决这个问题?
谢谢!