Well, encountered the need of a line-height coding a plugin, so, can you give an advice, please? Thanks)
Oh, thank you, I cannot understand why, but I simply forget that .css() can not only to set values, but also to get...
2009-07-26 18:33:25
Remember to mark the answer as correct when it is correct! =)
Christopher Done
2009-07-26 21:28:22
Yes, ok, I'm new here yet)
2009-07-26 21:43:28
Wrong. In opera it returns 'normal'.
Veton
2009-12-07 19:39:32
A:
$('selector').css('line-height');
Returns line height as a decimal value in pixels, with unit, e.g. "22.5px"
Care should be taken with this solution, as different browsers will report different results. I have found that you cannot use unitless measures with line-height (eg 2.2) in your CSS, as IE6 will report an incorrect result (eg 2px instead of, eg 36px). So I recommend using unit-based line-heights with this measure.
kenneth
2010-01-13 10:40:11