html - CSS 打字动画不适用于 Firefox

标签 html css firefox css-animations

今晚我一直在尝试为 Firefox 修复我的 CSS 打字动画 - 到目前为止没有成功。 Chrome 代码可以工作。我想念什么伙计们?

.css-typing
{
    width: 680px;
    white-space: nowrap;
    overflow: hidden;
    -webkit-animation: type 3s steps(50, end);
    animation: type 3s steps(55, end);
    -o-animation: type 5s steps(50, end);
    -moz-animation: type 3s steps(55, end);
    }


@keyframes type
    {
        from { width: 0; }
    }

@-moz-keyframes type
    {
        from { width: 0; }
    }

@-webkit-keyframes type
    {
        from { width: 0; }
    }

必须由这段代码定义的 div 如下所示:

<div class='css-typing'>This text will pop up using an typewriting effect</div>

有人发现我的错误吗?

最佳答案

需要设置@keyframes block 的to部分,还需要设置元素的宽度:https://jsfiddle.net/yak613/vtdyuju4/

.css-typing {
    width: 360px;
    white-space: nowrap;
    overflow: hidden;
    -webkit-animation: type 3s steps(50, end);
    animation: type 3s steps(55, end);
    -o-animation: type 5s steps(50, end);
    -moz-animation: type 3s steps(55, end);
}


@keyframes type
    {
        from { width: 0; }
        to { width: 360px; } 
    }

@-moz-keyframes type
    {
        from { width: 0; }
        to { width: 360px; } 
    }

@-webkit-keyframes type
    {
        from { width: 0; }
        to { width: 360px; } 
    }

关于html - CSS 打字动画不适用于 Firefox,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42100703/

相关文章:

linux - 在 Mozilla Firefox Web 浏览器中拦截动态内存分配调用

html - 如何让 Flexbox 元素与父元素具有相同的高度?

html - 悬停在 "box"后,文本不应该改变颜色吗?

css - 当有人编辑现有 sass 文件的 css 输出时如何修复

javascript - 内容 slider - JQuery 问题

javascript - 这种日期格式有什么问题

css - Webkit 不应用 css margin-bottom

php - 将 <Param> 中的名称放入变量中

html - 使用 CSS 边距和填充溢出页面容器的背景颜色

AMP 网站的纯 CSS 菜单