html - 无法弄清楚为什么每个跨度在动画期间重叠

标签 html css

基本上只是尝试制作一个在 0 和 o 之间反复切换而不重叠的动画。

有什么想法吗?

https://jsfiddle.net/ckfoch7v/

.rw-words-1 span{
animation: rotateWordsFirst 0.3s linear 0s infinite;
left: 11px;
top: 2px;
}


.rw-words span:nth-child(2) { 
    animation-delay: 0.2s; 

}
.rw-words span:nth-child(3) { 
    animation-delay: 0.4s; 

}

.rw-words span:nth-child(4) { 
    animation-delay: 0.6s; 

}
.rw-words span:nth-child(5) { 
    animation-delay: 0.8s; 

}

.rw-words span:nth-child(6) { 
    animation-delay: 0.9s; 

}


@keyframes rotateWordsFirst {
    0% { opacity: 1; animation-timing-function: linear; height: 0px; }
    95% { opacity: 1;}
    98% { opacity: 0; }
}

最佳答案

尝试使用两个 span。

它会起作用。

HTML

   <div class="alien">  <span>\ /</span>
    <span>.</span>

        <section class="rw-wrapper">
            <div class="rw-sentence">
                <div class="rw-words rw-words-1">   
                  <span>0</span>
                  <span>o</span>
                 </div>
            </div>
        </section>
    </div>

Demo Here

关于html - 无法弄清楚为什么每个跨度在动画期间重叠,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32431357/

相关文章:

javascript - Rails 服务器返回 HTML 而不是 JavaScript

javascript - JavaScript文件放在head中时构造 'CustomElement'错误失败

CSS3 div 和 last-child - 怎么样?

html - 居中 2x2 网格

javascript - 将内联 js 移动到外部 js 文件导致错误

html - 如何将子div垂直居中放置在父div的中心?

Javascript在网页上执行js,例如chrome控制台

html - 如何在 Jumbotron 上具体定位按钮?

css - 为什么 z-index 不适用于 div?

jquery - 在没有类的情况下对一个元素产生悬停效果