在哪里定义 px 到 em 映射?
我从 w3schools 那里听说 1 em = 16px
。 http://www.w3schools.com/css/css_font.asp
但是,在我的Jekyll 网站
即使我设置了 字体大小:
body
和 font-size: 1em
中为 100%。
我错过了什么吗?
I heard from w3schools that 1 em = 16px
.
http://www.w3schools.com/css/css_font.asp
However, in my Jekyll site
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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在
global.css
的第 27 行,字体 -主体尺寸已覆盖为 76%,16px*0.76 = 12.16pxAt line 27 of
global.css
the font-size of body has been overridden to 76%, 16px*0.76 = 12.16px1 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.