我正在尝试创建一个网站的加载器动画,但由于某些原因,它不工作。你知道我在css上做错了什么吗?
HTML部件
<footer>
<div class="container has-text-centered">
<div class="loadingdots">
<span class="dots has-text-centered"> · </span>
<span class="dots has-text-centered"> · </span>
<span class="dots has-text-centered"> · </span>
</div>
</div>
</footer>
css部件
.loadingdots {
opacity: 1;
bottom: 50px;
transition: opacity 0.3s ease-in;
}
.dots{
font-size:80px;
color: #1E1E1E;
height: 10px;
animation: bounce 0.5s ease-in infinite;
padding: 10px;
}
.dots:nth-of-type(2) {
animation-delay: 0.1s;
}
.dots:nth-of-type(3) {
animation-delay: 0.2s;
}
@keyframes bounce {
0%,
100% {
transform: translateY(0);
}
50% {
transform: translateY(-10px);
}
}
非常感谢。目前,这就是我在我的页面上看到的。Website look with the dots for loading...
谢谢你的帮助!干杯!
发布于 2021-01-30 06:14:01
将span元素设置为display: inline-block;
.loadingdots {
opacity: 1;
bottom: 50px;
transition: opacity 0.3s ease-in;
}
.dots{
font-size:80px;
color: #1E1E1E;
height: 10px;
animation: bounce 0.5s ease-in infinite;
padding: 10px;
/* ADDED */
display: inline-block;
}
.dots:nth-of-type(2) {
animation-delay: 0.1s;
}
.dots:nth-of-type(3) {
animation-delay: 0.2s;
}
@keyframes bounce {
0%,
100% {
transform: translateY(0);
}
50% {
transform: translateY(-10px);
}
}
<footer>
<div class="container has-text-centered">
<div class="loadingdots">
<span class="dots has-text-centered"> · </span>
<span class="dots has-text-centered"> · </span>
<span class="dots has-text-centered"> · </span>
</div>
</div>
</footer>
https://stackoverflow.com/questions/65961466
复制相似问题