在哪里定义 px 到 em 映射?

发布于 2024-11-29 23:09:33 字数 412 浏览 5 评论 0原文

我从 w3schools 那里听说 1 em = 16pxhttp://www.w3schools.com/css/css_font.asp

但是,在我的Jekyll 网站

http://madhur.github.com

即使我设置了 字体大小: bodyfont-size: 1em 中为 100%。

我错过了什么吗?

I heard from w3schools that 1 em = 16px.
http://www.w3schools.com/css/css_font.asp

However, in my Jekyll site

http://madhur.github.com

The standard font in paragraph is 12px even though I have set font-size: 100% in body and font-size: 1em.

Am I missing something?

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

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

发布评论

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

评论(2

无敌元气妹 2024-12-06 23:09:33

global.css 的第 27 行,字体 -主体尺寸已覆盖为 76%,16px*0.76 = 12.16px

At line 27 of global.css the font-size of body has been overridden to 76%, 16px*0.76 = 12.16px

恋你朝朝暮暮 2024-12-06 23:09:33

1 em 是标准字体和尺寸中字母“M”的宽度。 em 完全取决于您设置的字体大小和字体。 font-size: 1 em 几乎意味着 font-size: 100%;

如果你的字体大小已经是 16px,那么 Em 就只有 16px。

One em is the width of the letter "M" in your standard font and size. em is completely dependent on what you set your font-size and font as. font-size: 1 em pretty much means font-size: 100%;

Em is only 16px if your font-size already is 16px.

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