Finding the exact line-height of the font-size :)


#1

hi everybody…

How do you guys find the exact line-height of the font-size ?..

Fore example


h1{

font-size:21px;
line-height: ? "What will be it's exact line-height"

}

Thanks in advanced

Regards,

Satish


#2

It depends on any previously set style. On the body tag the line-height might be set to 1.5, which would give the h1 a line height of 31.5px


#3
dpthemes said

It depends on any previously set style. On the body tag the line-height might be set to 1.5, which would give the h1 a line height of 31.5px

Thanks…But how it will be 31.5px can you show me procedure to calculate :slight_smile:

Suppose :


body{

line-height:1.7;

}

h1{

font-size:21px;

}

So , how to calculate line-height of font size of 21px;


#4

It would be 1.7em for the line-height, and then wherever you need to just use 1.7em, would be 1.7* the font size of 21 pixels, AKA the line-height.


#5
Pressateers said

It would be 1.7em for the line-height, and then wherever you need to just use 1.7em, would be 1.7* the font size of 21 pixels, AKA the line-height.

Thanks :slight_smile:


#6

Looks like you got it sorted, but line-height is generally used as a unitless value. ie. 1.7 instead of 1.7em.