tags:

views:

242

answers:

5

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?

+8  A: 

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

Haim Evgi
+1  A: 

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.

streetpc
Nice article! +1
Blixt
+1  A: 

If no unit is supplied e.g. "line-height: 1.5" the distance between the lines is set as this number multiplied with the current font size.

1.5 x font-size

jitter
+2  A: 

According to w3schools and w3.org line-height:1; is valid and means the following: Sets a number that will be multiplied with the current font-size to set the distance between the lines.

merkuro
same as line-height:1em; ?
Typeoneerror
A: 

It's a multiple of the font size. From the CSS 2.1 Candidate recommendation: »The used value of the property is this number multiplied by the element's font size.«

Joey