gpt4 book ai didi

html - rem 字体大小无法在 css 动画中正确呈现

转载 作者:行者123 更新时间:2023-11-27 23:49:36 24 4
gpt4 key购买 nike

因此,我试图用一个句子来使某些单词具有动画效果(旋转)- 我认为它可以正常工作,但是在我的手机上查看该网站后,我发现了一个问题。在桌面上(甚至在开发工具中)查看时,动画文本以正确的大小呈现。但是,一旦我在移动设备(iPhone)上查看它,文本就会变得非常小

我也在页面上使用 Bootstrap ,所以我认为可能有什么被覆盖了。但如您所见,我基本上删除了所有 Bootstrap 类,但它仍然无法正常工作。

.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/当您在桌面上查看时,所有蓝色文字的大小都是正确的。但是,一旦您在移动设备上查看它,动画文本就会变得很小。

最佳答案

您可以检查您的网页在移动设备上的外观和性能:

https://developers.google.com/web/tools/chrome-devtools/device-mode/

您还可以使用媒体查询自定义内容。标准设备的媒体查询

如果您想了解更多信息,可以访问: https://css-tricks.com/snippets/css/media-queries-for-standard-devices/

关于html - rem 字体大小无法在 css 动画中正确呈现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56615964/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com