最佳答案
据我所知,当屏幕缩放级别增加时,唯一不会缩放的单位是视口(viewport)百分比单位(vh
和 vw
以及那些基于这些)。这些可以设置为任何其他单位:
p {
font-size: 2vw;
}
以下来自MDNs explanation on these units :
vh: Equal to 1% of the height of the viewport's initial containing block.
vw: Equal to 1% of the width of the viewport's initial containing block.
vmin: Equal to the smaller of vw and vh.
vmax: Equal to the larger of vw and vh.
要了解如何将这些用于文本,请参阅 CSS-Tricks on Viewport Sized Typography 上的一篇文章.它可能并不适合每个网站,但对于正确的用例来说肯定是可能的。
关于html - 如何防止windows文本缩放当前文档,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47474157/