It is a question about the appointment of line-height.
I began study of css. line-height: Examples appointing 20px or a unit are often found. It is sometimes line-height: There are 1 and a thing without a unit, but what kind of meaning does this become?
line-height: 1.5 (without units) will mutiply the element's font size by 1.5 to compute the line height. line-height: 150% will take 150% of the element's computed font size to compute the line height, which is equivalent to multiply it by 1.5 .
The line-height CSS property sets the height of a line box. It's commonly used to set the distance between lines of text. On block-level elements, it specifies the minimum height of line boxes within the element. On non-replaced inline elements, it specifies the height that is used to calculate line box height.
@BoltClock, line-height: 0 means a minimum line height of 0. I think it is more related to how height: auto is calculated. – youfu. Feb 12, 2016 at 9:30. And height: auto means the height of the content, so the used line height is, evidently, non-zero, and that is what's giving the BCB its height.
The line-height property in CSS controls the space between lines of text. It is often set in a unitless value (e.g. line-height: 1.4; ) so that it is proportional to the font-size. It's a vital property for typographic control.
Possible Values
number :
Sets a number that will be multiplied with the current font-size to set the distance between the lines
length :
Sets a fixed distance between the lines
% :
Sets a distance between the lines in % of the current font size
take from http://www.w3schools.com/css/pr_dim_line-height.asp
It seems that line-height
doesn't need a unit (detailled article).
The property line-height can accept unitless number values. You can also give line-height united values, though generally you shouldn’t. But unitless numbers are just fine for this property.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With