html - CSS Transition 不适用于我的网站,但适用于 codepen

标签 html css sass css-transitions

我有一个简单的 CSS 过渡,当您将鼠标悬停在按钮上时,它会缓缓进入框阴影。但出于某种原因,转换在我的网站上不起作用。我的网站上有其他 CSS 转换效果很好,但这个很难。有什么可能会阻碍过渡吗? :hover 立即反对像我想要的那样使用缓动效果。

我正在使用 Sass,但我不确定这是否会有所不同:

.btn.btn-more {
    background: none;
    border: 1px solid #dadada;
    color: #555;
    font-size: 14px;
    font-weight: bold;
    margin-top: 10px;
    min-width: 130px;
    padding-top: 10px;
    padding-bottom: 10px;
    transition: all 0.5s ease-in-out;
    -moz-transition: all 0.5s ease-in-out;
    -webkit-transition: all 0.5s ease-in-out;
    -o-transition: all 0.5s ease-in-out;
    -ms-transition: all 0.5s ease-in-out;
    vertical-align: middle;

    &:hover {
        box-shadow: 0 1px 4px #999;
    }
}

本网站使用的是 Bootstrap 2.3.2,这是 .btn 的来源。我已经在 Chrome 和 Safari 中尝试过这个。

最佳答案

.btn 正在覆盖转换,Chrome 开发工具直到我在新选项卡中打开页面并再次打开开发工具才显示该覆盖。

关于html - CSS Transition 不适用于我的网站,但适用于 codepen,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48798197/

相关文章:

html - Bootstrap 目录网格

javascript - 再次重新加载时删除 parentElement 并保存更改

ruby - Ruby Sass弃用-如何查看我的版本是否被弃用

javascript - 如何在其父项悬停时更改组件的样式?

javascript - 隐藏在 Nivo slider 后面的 CSS 菜单栏

css - SASS 看不到变量

html - div 中的居中按钮未正确排列

javascript - 页面布局设置

css - 所有按钮问题

asp.net - 防止面板内用户控件的宽度溢出