The line height setting in CSS is used to set the height between lines of text in the element, set through the line-height attribute. Setting methods include: Value: fixed height (pixel or unit value) Percentage: percentage based on the font size of the parent element Unitless value: set the default value (normal) or inherit the parent element line height (inherit)
Row height setting in CSS
In CSS, line height is used to set the height between lines of text in an element. It can be set via theline-height
property.
Setting method:
line-height: value;
Value type:
line-height: 20px;
line-height: 150%;
Unitless value:Some special unitless values, such as:
Example:
/* 将段落中的行高设置为 1.5 倍的字体大小 */ p { line-height: 1.5em; } /* 将标题中的行高设置为 20 像素 */ h1 { line-height: 20px; }
Note:
The above is the detailed content of How to set row height in css. For more information, please follow other related articles on the PHP Chinese website!