【问题标题】:How to set hover transition when the mouse gets out of the element [duplicate]当鼠标离开元素时如何设置悬停过渡[重复]
【发布时间】:2021-05-31 01:51:35
【问题描述】:

我为我的按钮设置了悬停过渡,但是正如您所见,当鼠标离开按钮时,没有像以前那样的动画我应该怎么做才能获得过渡? 非常感谢。

#button{
background-color: #F69680;
border: 2px solid   #2e2263;
text-align: center;
text-transform: uppercase;
text-decoration: none;
outline: none;
margin-top: 20px;
padding: 10px 20px;
color:  #2e2263;
}

#button:hover{
    transition: 0.25s;
    background-color:  #2e2263 ;
    color:  #F69680;
    padding: 15px 30px;
}

【问题讨论】:

    标签: html css


    【解决方案1】:

    我确信有更好的解决方案,但您可以在 #button 上设置过渡,因此如果按钮不再悬停,#button 将被执行/绘制。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-02-13
      • 2021-10-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-08-30
      相关资源
      最近更新 更多