Home  >  Article  >  Web Front-end  >  How to use css line-height property

How to use css line-height property

silencement
silencementOriginal
2019-05-28 09:40:132828browse

How to use css line-height property

css line-height attribute definition and usage

Definition and usage

The line-height attribute sets the distance between lines (row height).

Note: Negative values ​​are not allowed.

Explanation

This attribute will affect the layout of the line box. When applied to a block-level element, it defines the minimum distance between baselines in that element rather than the maximum distance.

The calculated difference between line-height and font-size (known as "line spacing" in CSS) is divided into two halves and added to the top and bottom of a line of text content. The smallest box that can contain this content is a line box.

The original numeric value specifies a scaling factor, and descendant elements will inherit this scaling factor rather than the calculated value.

How to use css line-height property

Possible values

How to use css line-height property

##Instance

Settings Row height in percent:

p.small {line-height:90%}
p.big {line-height:200%}

The above is the detailed content of How to use css line-height property. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn