gpt4 book ai didi

css - 字母间距不适用于移动浏览器,仅限桌面

转载 作者:太空宇宙 更新时间:2023-11-04 13:23:22 25 4
gpt4 key购买 nike

我在“REM”中使用尺寸,令我惊讶的是字母间距在移动浏览器、Android 和 iOS 中不起作用。桌面工作正常。

CSS

#header{
position: relative;
text-align: center;
overflow: hidden;
height: initial;
}

#header h1{
position: absolute;
font-size: 12rem;
right: 3rem;
margin: 0;
text-shadow: 0 4px #570b0b;
letter-spacing: -0.7rem; /* Work Only Desktop */
}

桌面: enter image description here

手机: enter image description here

最佳答案

尝试word-spacing ...尽管我总是使用ems:

#header h1{
position: absolute;
font-size: 12rem;
right: 3rem;
margin: 0;
text-shadow: 0 4px #570b0b;
letter-spacing: -0.7rem; /* Work Only Desktop */
word-spacing: -0.7rem;
}

*更新:

我看到你在使用 webfont 检查这个,看看它是否有用:

Webkit, letter-spacing issues with webfonts

唯一的其他答案是:

  • 将 REM 更改为 EM 并进行测试

  • Web 字体 - 确保最后有 svg

关于css - 字母间距不适用于移动浏览器,仅限桌面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23893333/

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