What is line spacing.
In ancient times we used printing presses to come out text. Every word that is printed is in a separate block.
Line spacing, that is, the legendary control of two lines of text vertical distance. In CSS, Line-height is used to control the vertical distance between rows and rows.
However, the line spacing and half line spacing depends on the line-height in the CSS. So, how to use Line-height?
Default state, the browser uses 1.0-1.2 line-height, which is an initial value. You can define the Line-height property to override the initial value: p{line-height:140%}
There are 5 ways you can define line-height.
1.line-height can be defined as: body{line-height:normal;}
2.line-height can be defined as: Body{line-height:inherit;}
3.line-height can use a percentage of the value body{line-height:120%;}
4.line-height can be defined as a length value (px,em, etc.) body{line-height:25px;}
5.line-height can also be defined as pure numbers, body{line-height:1.2}
Abbreviation Line-height
The 5 types of line-height can be abbreviated in the font attribute. The value of the line-height follows the Font-size value and is separated by a slash, such as:<font-size>/<line-height>
Example: Body{font:100%/normal Arial;, body{font:100%/120% Arial;, body{font:100%/1.2 Arial; , body{font:100%/25px Arial;
Calculate Line-height
Some CSS attributes are inheritable (inherited) and are passed down from a cascade of elements. This is done to facilitate developers and no longer reset values for descendant elements.
It's a bit complicated for line-height inheritance.
1, percentage
2. Length
3 Value: Normal
4 Pure digits
(But the actual application in the Chinese font or in the English font mix, as well as Ie678,xp Win7, row high rules and different, tearful)