What's the difference between line-height:1.5 and line-height:150% in css? -
anyone knows it?
short version: line-height: 150% static, line-height: 1.5 dynamic. effect more evident on inheriting elements. example:
html
<div style="font-size: 12px">     <span style="font-size: 24px">test</span> </div>   this css
div { line-height: 150%; } /* computed line-height: 18px (150% * 12px) */ span { }                   /* computed line-height: 18px (inherited directly) */   as opposed this:
div { line-height: 1.5 }   /* computed line-height: 18px (1.5 * 12px) */ span { }                   /* computed line-height: 36px (1.5 * 24px) */   you may read more @ css2 specs page
Comments
Post a Comment