【问题标题】:Transition between :hover and leaving :hover?:hover 和离开 :hover? 之间的转换
【发布时间】:2013-08-01 08:26:12
【问题描述】:

所以我试图让我的分页在悬停时平滑滑过,然后在鼠标离开元素后滑回原来的位置。我让它在悬停时滑动,但是当鼠标离开按钮时,它只是弹回而不是过渡。有人可以帮我解决这个问题吗?

这是我的代码。

#pagination {
   width: auto;
   margin-top: 4px;
   font-size: 40px;
   height: auto;
   border-left: 5px solid #2F4F4F;
   border-right: 1px solid #2F4F4F;
   text-shadow: 
   -1px 1px #000000;
   -2px 2px #000000;
   -3px 3px #000000;
   background: #ffffff;
   -webkit-transition: all 0.5s ease-in-out;
   -moz-transition: all 0.5s ease-in-out;
   -o-transition: all 0.5s ease-in-out;    
}

#pagination :hover {
    background: #2F4F4F;
    border-left: 15px solid #2F4F4F;
    border-right: 1px solid #7A8B8B;
    width: auto;
   -webkit-transition: all 0.5s ease-in-out;
   -moz-transition: all 0.5s ease-in-out;
   -o-transition: all 0.5s ease-in-out;    
}

【问题讨论】:

    标签: css hover transition


    【解决方案1】:

    :hover 需要在元素后面指定,不能有空格。

    #pagination :hover
    

    #pagination:hover
    

    【讨论】:

    • 天哪,我很昏暗。非常感谢!
    • 很容易犯错误!:) 很高兴我能提供帮助。选择我的答案,这样就没有其他人出现了:)
    猜你喜欢
    • 1970-01-01
    • 2011-11-30
    • 1970-01-01
    • 1970-01-01
    • 2012-01-05
    • 1970-01-01
    • 1970-01-01
    • 2011-10-11
    • 1970-01-01
    相关资源
    最近更新 更多