【发布时间】:2019-10-30 03:23:44
【问题描述】:
因此,我正在尝试创建一个句子,其中某些单词是动画的(循环播放) - 我认为它可以正常工作,但是当我在手机上查看该网站时,我发现了一个问题。 在桌面上(甚至在开发工具中)查看时,动画文本会以正确的大小呈现。但是,一旦我在移动设备(iPhone)上查看它,文字就会变得非常小
我也在页面上使用引导程序,所以我认为可能有些东西被覆盖了。但正如你所见,我基本上删除了所有引导类,但它仍然无法正常工作。
.animated span {
color: #007bff;
font-size: 0;
opacity: 0;
-ms-animation: topToBottom 10s infinite;
-webkit-animation: topToBottom 10s infinite;
animation: topToBottom 10s infinite;
}
.animated span:nth-child(2) {
-ms-animation-delay: 2s;
-webkit-animation-delay: 2s;
animation-delay: 2s;
}
.animated span:nth-child(3) {
-ms-animation-delay: 4s;
-webkit-animation-delay: 4s;
animation-delay: 4s;
}
.animated span:nth-child(4) {
-ms-animation-delay: 6s;
-webkit-animation-delay: 6s;
animation-delay: 6s;
}
.animated span:nth-child(5) {
-ms-animation-delay: 8s;
-webkit-animation-delay: 8s;
animation-delay: 8s;
}
@-webkit-keyframes topToBottom {
0%,
20% {
font-size: 2.5rem;
opacity: 1;
}
/* visible for 1s */
20.01%,
100% {
opacity: 0;
font-size: 0rem;
}
<h1 class=" cover-heading animated">TribePulse replaces <br />
<span>status updates</span>
<span>engagement surveys</span>
<span>progress reports</span>
<span>status meetings</span>
<span>EoD emails</span>
</h1>
故障演示:https://empty-cemetery.glitch.me/ 当您在桌面上查看时,所有的蓝色字迹都是正确的大小。但是,一旦您在移动设备上查看,动画文字就会变得很小。
【问题讨论】:
-
我检查了我的手机、平板电脑、分辨率转换器、chrome、firefox 和另一部手机。它们都是相同的大小,动画文本没有变化。我认为你的手机可能有问题。
-
奇怪...我也试过手机上的不同浏览器,但问题仍然存在
标签: html css mobile css-animations font-size