css3 变换 :scale doesn't work in Safari

标签 css animation

尝试使这种效果起作用,在 chrome 和 opera 上运行良好,但在 safari 或 firefox 上运行不正常。

怎么了?

我在我的 html 代码中使用了一个 span 标签

CSS

@-webkit-keyframes pulse {
    0% {
       -webkit-transform: scale(1, 1);
    }
    50% {
        -webkit-transform: scale(1.3, 1.3);
    }
    100% {
        -webkit-transform: scale(1, 1);
    } 
}
@keyframes pulse {
    0% {
        transform: scale(1, 1);
    }
    50% {
        transform: scale(1.3, 1.3);
    }
    100% {
        transform: scale(1, 1);
    }
}

.take {
    margin-left: 40px;
    color: #c8262d;
    width: 20px;
    height: 20px;
    -webkit-animation: pulse 1s linear infinite;
    animation: pulse 1s linear infinite;
}

HTML

<span class="take">Take Action Today &DDotrahd;</span>

最佳答案

我认为您只需要将 display:block; 添加到您的 .take 规则

.take {
    margin-left: 40px;
    color: #c8262d;
    width: 20px;
    height: 20px;
    -webkit-animation: pulse 1s linear infinite;
    animation: pulse 1s linear infinite;
    display:block;
}

http://jsfiddle.net/28q6cy2j/2/

关于css3 变换 :scale doesn't work in Safari,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26520024/

相关文章:

ios - 使一个 UIView 跟踪另一个约束的动画

javascript - 如何防止在 jQuery 动画切换上重复动画?

Window.Resources 内的 WPF ColorAnimation

html - 如何将鼠标悬停在 <li> 元素上并在两个图标之间切换[无需 JavaScript]

javascript - 如何修复 jQuery 中不稳定的动画

html - 如何设置几个表格水平? Bootstrap

javascript - 使链接仅适用于后代 child ,但不包括他们的空白空间

javascript - 子菜单动画 "pops up"

HTML 如何使表格中的每个条目都成为一个按钮

css - 为什么 -webkit-box-flex 属性对此不起作用?