【问题标题】:I want to transition for button but it is not working?我想转换按钮,但它不起作用?
【发布时间】:2021-09-17 00:12:32
【问题描述】:
.free-btn {
a {
    position: relative;
    .fbtn-bg {
        display: inline-block;
        font-size:20px;
        font-weight: 600;
        color:#000;
        padding:20px 85px;
        background: #f4f4f4;
        border-radius: 14px;
        z-index: 100;
        position: relative;
        transition: all .5s ease-in-out;
        &:hover {
            top:10px;
            right: -10px;
            transition: all .5s ease-in-out;
        }
    }
}

}

我想为 buttun 过渡,但它不起作用。我的错误在哪里,你们能帮帮我吗?

【问题讨论】:

  • 添加您的 html。吕特芬
  • 问题已解决,感谢您的支持。

标签: css sass css-transitions


【解决方案1】:

你应该使用 translate() 而不是使用左右。 悬停选择器应如下所示:

:hover {
  transform: translate(10px , 10px);
}

【讨论】:

  • 这是理想的。悬停效果中也不需要额外的过渡属性。您只需要在初始对象中使用它。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-03-19
  • 2020-10-30
  • 1970-01-01
  • 1970-01-01
  • 2020-06-29
相关资源
最近更新 更多