当以像素为单位设置CSS font-size时,值是指字母的宽度还是高度? [英] When setting CSS font-size in pixels, does the value refer to the width or height of a letter?

查看:600
本文介绍了当以像素为单位设置CSS font-size时,值是指字母的宽度还是高度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

字体大小的像素值是指字体的高度还是字体的宽度?

Does the pixel value of a font-size refer to the height of the font or the width of the font?

CSS:

.sixteen {
  font-size: 16px;
}

HTML:

<span class='sixteen'>a</span>

a的高度为16像素或16像素,宽度/高度,以便整个字符适合在一个16px的盒子?

Will the "a" be 16 pixels tall or 16 pixels wide, or is that like a max-width/height on both so that the entire character fits in a 16px box?

所有的文档,我已经看到这个问题上是不明确的。

All the documentation I have seen for this has been ambiguous on the matter.

推荐答案

高度 - 特别是从上升的顶部(例如'h'或'l'(el))到下降(例如,'g'或'y')。请参阅 http://en.wikipedia.org/wiki/Typeface_anatomy 上的有关类型解剖的有趣文章。

The height - specifically from the top of the ascenders (e.g., 'h' or 'l' (el)) to the bottom of the descenders (e.g., 'g' or 'y'). See the interesting article on Type Anatomy at http://en.wikipedia.org/wiki/Typeface_anatomy.

这篇关于当以像素为单位设置CSS font-size时,值是指字母的宽度还是高度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆