我正在尝试在css中制作选框,这会在悬停在元素上时减慢速度.我已经完成了类似的操作,但它并没有停止主动画,当鼠标退出选框时,它会回到它的位置,好像我什么也没做.
这是CSS和HTML中的代码
.prices {
background-color: #f5fafd;
font-size: 14px;
padding: 6px 0;
border-bottom: solid 1px #d9d9d9;
margin-left: 0;
margin-right: 0;
}
.currency {
text-align: center;
color: #444444;
font-weight: 300;
}
.marquee {
height: 30px;
min-width: 640px;
width: 100%;
overflow: hidden;
position: relative;
}
.marquee p {
position: absolute;
width: 640px;
height: 100%;
margin: 0;
line-height: 30px;
text-align: center;
transition: all 0.3s ease;
transform: translateX(100%);
animation: scroll-left 20s linear infinite;
}
.marquee:hover p {
transform: translateX(100%);
animation: scroll-left 30s linear infinite;
} …Run Code Online (Sandbox Code Playgroud)