gpt4 book ai didi

css - 将字体大小设置为大于 100% 的优点

转载 作者:技术小花猫 更新时间:2023-10-29 11:23:46 26 4
gpt4 key购买 nike

在这个非常棒的guide to developing a responsive design ,作者讨论了设置在较小屏幕尺寸下变得流畅的固定列宽:

Content is 37.62136em wide (multiply that with 16px browser default and the 103% font-size I have on content = 620px) until the smaller viewports when it expands to 100% width.

让我困惑的部分是使用font-size: 103%。结果是浏览器将文本呈现为 17px,那么为什么不手动设置它并根据 17px 的 em 计算内容 div 的宽度呢?也许使用大于 100% 的字体大小会产生其他我不知道的副作用?

最佳答案

我认为 103% 的选择没有任何秘诀。我的猜测是 103%/17px 最适合字体。

只要您以 em 为单位设置其他所有内容,您就可以轻松地缩放 htmlbody 上的字体大小以具有这些变化反射(reflect)在整个网站上。基本字体大小(我通常将其保留为 100%/16px)是一个偏好问题。

关于css - 将字体大小设置为大于 100% 的优点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15505265/

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