断点和字体大小混乱

发布于 2025-01-22 11:20:19 字数 164 浏览 2 评论 0原文

我正在研究投资组合的媒体查询元素,其中断点的转换导致字体大小不同。例如 -

如果断点为1200px,那么EM将为75。那么,为什么字体大小为60%?

@media (max-width: 75em) {html {font-size: 60%;}}

I am working on a Media Query element of my portfolio where the breakpoint's conversion is leading to different font sizes. For example -

if the breakpoint is 1200px then the em would be 75. so why the font-size is 60%?

@media (max-width: 75em) {html {font-size: 60%;}}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

昨迟人 2025-01-29 11:20:19

如果您希望字体大小为75em,最高为1200px,则需要以下内容:

@media (max-width: 1200px) {html {font-size: 75em;}}

您已发布的示例意味着,断点为75em,而显示的字体大小设置为60%。没有完整的代码,绝对不可能说出这些数字会产生的尺寸,因为“ em”和“%”相对于根部尺寸。

If you want the font-size to be 75em up to 1200px, then you need this:

@media (max-width: 1200px) {html {font-size: 75em;}}

Your posted example means, that the breakpoint is at 75em and the font-size shown is set to 60%. Without the full code it is absolute not possible to say what sizes these numbers generate because 'em' and '%' are relative to the root-font-size.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文