CSS 以像素为单位的字体大小:它测量什么?

CSS font-size in pixels: what does it meaure?

CSS 的字体大小可以使用 "px" 像素。但是,给定的像素究竟测量的是什么?

取14px,是不是说没有字母会超过14px?这是字母高度的平均大小吗?那是最高字母的尺寸吗?还是完全不同的措施?

这可能会回答您的问题:

盗自:https://graphicdesign.stackexchange.com/questions/199/point-vs-pixel-what-is-the-difference

A pixel is a single square 'picture element' (hence pix-el), i.e. a single dot in your image. A 10x10 image is made up of a set of pixels in a grid 10 wide by 10 high, totaling 100 pixels.

The 'point' (pt) on the other hand is a unit of length, commonly used to measure the height of a font, but technically capable of measuring any length. In applications, 1pt is equal to exactly 1/72th of an inch; in traditional print technically 72pt is 0.996264 inches, although I think you'll be forgiven for rounding it up!

How many pixels = 1pt depends on the resolution of your image. If your image is 72ppi (pixels per inch), then one point will equal exactly one pixel.

字体通常包含除拉丁字母以外的其他字符。其中一些将达到拉丁字母最高的上升部分之上或最深的下降部分之下。因此,字体大小指定了字符框的高度,字体中所有可能的字形都必须适合该字符框。拉丁字母可能会也可能不会利用该框的全部范围。