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

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

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

dpthemes said

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

Suppose :

body{ line-height:1.7; } h1{ font-size:21px; }

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

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.

Pressateers said

Thanks

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