这是我用于动画的 CSS。任何帮助让这项工作将不胜感激。背景图像应该越来越大并与按钮的文本一起居中。然而,当我盘旋时,它静静地愤怒地坐在那里,拒绝移动。
@keyframes buttonAnim{
from{
background-color: rgba(63,62,68,0.75);
background-size: 40%;
background-position: left;
padding-left:40px;
text-align: left;
}
to {
background-color: rgba(63,62,68,0.95);
background-size: 100%;
background-position: center;
padding-left:0px;
text-align: center;
}
}
.button{
color:White;
background-image: url(/images/buttonBack.png);
background-color: rgba(63,62,68,0.75);
border: white 1px solid;
border-radius: 5px;
background-size: 40%;
background-position: left;
background-repeat: no-repeat;
padding-left: 30px;
text-align: left;
min-height: 40px;
line-height: 38px;
}
.button:hover{
animation: buttonAnim 1s;
}