是否可以在 Android 版本 2 或更低版本上使用小于 8px 的 css font-size
我需要使用小于 8px 的字体大小。但 Android 版本 2 或更早版本似乎强制将 font-size 设为 8px 作为最小尺寸。
有没有办法让字体大小小于8px?
这是我使用的 html/css:
...
<meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1" />
...
<p style="font-size: 12px">Hello 12px</p>
<p style="font-size: 11px">Hello 11px</p>
<p style="font-size: 10px">Hello 10px</p>
<p style="font-size: 9px">Hello 9px</p>
<p style="font-size: 8px">Hello 8px</p>
<p style="font-size: 7px">Hello 7px</p>
<p style="font-size: 6px">Hello 6px</p>
<p style="font-size: 5px">Hello 5px</p>
<p style="font-size: 4px">Hello 4px</p>
<p style="font-size: 3px">Hello 3px</p>
<p style="font-size: 2px">Hello 2px</p>
这是 Andorid 2.2 上的结果:
I need to use font-size smaller than 8px. But Android version 2 or earlier seems to force font-size to 8px as the smallest size.
Is there any way to get the font-size smaller than 8px?
Here is the html/css I use:
...
<meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1" />
...
<p style="font-size: 12px">Hello 12px</p>
<p style="font-size: 11px">Hello 11px</p>
<p style="font-size: 10px">Hello 10px</p>
<p style="font-size: 9px">Hello 9px</p>
<p style="font-size: 8px">Hello 8px</p>
<p style="font-size: 7px">Hello 7px</p>
<p style="font-size: 6px">Hello 6px</p>
<p style="font-size: 5px">Hello 5px</p>
<p style="font-size: 4px">Hello 4px</p>
<p style="font-size: 3px">Hello 3px</p>
<p style="font-size: 2px">Hello 2px</p>
And here is the result on an Andorid 2.2:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
答案是肯定的,在你的CSS中使用这一行:
在这里找到答案
您可以将其读作嗯
And the answer is yes, use this line in you css:
Answer found here
And you may read this as well