CSS 中的行高是从文本的底部到下一行文本的底部吗?还是文本在行内垂直居中?
请看示例图片:
最佳答案
Form MDN :
On block level elements, the line-height CSS property specifies the minimal height of line boxes within the element.
On non-replaced inline elements, line-height specifies the height that is used in the calculation of the line box height.
正如您在此 DEMO 中看到的那样 和下图。这意味着对于文本,line-height
定义框内垂直居中字母周围的框的高度,因此您的第一个示例是正确的。
图片来自 www.w3.org
关于css - CSS 行高是如何测量的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23247800/