📜  CSS Line Height属性

📅  最后修改于: 2020-11-04 06:22:55             🧑  作者: Mango

CSS行高

CSS line height属性用于定义元素中线框的最小高度。它设置内容的两行之间的差异。

它定义了内联元素上方和下方的空间量。它允许您独立于字体大小来设置行的高度。

CSS行高值

有些属性值与CSS line-height属性一起使用。

value description
normal This is a default value. it specifies a normal line height.
number It specifies a number that is multiplied with the current font size to set the line height.
length It is used to set the line height in px, pt,cm,etc.
% It specifies the line height in percent of the current font.
initial It sets this property to its default value.
inherit It inherits this property from its parent element.

CSS行高示例







This is a heading with a standard line-height.
This is a heading with a standard line-height.
The default line height in most browsers is about 110% to 120%.

This is a heading with a smaller line-height.
This is a heading with a smaller line-height.
This is a heading with a smaller line-height.
This is a heading with a smaller line-height.

This is a heading with a bigger line-height.
This is a heading with a bigger line-height.
This is a heading with a bigger line-height.
This is a heading with a bigger line-height.