【发布时间】:2017-12-30 10:27:45
【问题描述】:
我目前正在为一个小组开发一个网站,我正在尝试为“加载中...”一词中的一些点设置动画,以便它们闪烁。我已经让动画工作了,但由于某种原因,除非我用光标突出显示文本,否则这些点不会出现。
@keyframes blink {
0% {
opacity: .2;
}
20% {
opacity: 1;
}
100% {
opacity: .2;
}
}
.text span {
animation-name: blink;
animation-duration: 1.4s;
animation-iteration-count: infinite;
animation-fill-mode: both;
}
.text span:nth-child(2) {
animation-delay: .2s;
}
.text span:nth-child(3) {
animation-delay: .4s;
}
.text {
width: 300px;
height: 70px;
font-size: 30px;
background: -webkit-linear-gradient(#ffffff, rgb(183,183,183));
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
text-align: center;
color: white;
}
<div class="text">Loading<span>.</span><span>.</span><span>.</span></div>
文本的“正在加载”部分显示得很好。有什么想法吗?
谢谢
【问题讨论】:
-
对我来说很好。
-
好了,有什么想法吗?
-
你现在的做法是,你无能为力 - 文本已经是透明的,所以改变不透明度没有任何作用。
-
对修复有任何想法吗?
-
我的回答解决了你的问题吗?