gpt4 book ai didi

html - flex 布局中 62.5% 字体大小的用途

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

现有的做法是将 body font 设置为 62.5 %,因此 1 em 等于 10 px。此外,众所周知,这种方法有一些缺点。

body {
font-size: 62.5%;
}

如多篇文章所述,

报价单1st article :

The 62.5% trick is a common one, and does have its uses in two circumstances:

  • You want simpler maths, for example if you are building an elastic layout (width:30em; == width:300px;)

  • <...>

引自 another article :

The 62.5% Hack is a common one and has its uses and drawbacks.

I only recommend using it if you want simpler maths, for example if you are building an elastic layout.

我想知道 62.5 %-trick 究竟如何帮助构建 flex 布局。一些简单的例子?

最佳答案

如果您使用 rem 设置所有内边距/边距 - 这样您就知道 100% 浏览器缩放时 1rem = 10px。

关于html - flex 布局中 62.5% 字体大小的用途,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42044043/

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