Let's say I have a DIV: <div></div>
and I want to find out with JS what its line-height is. I know one can check the style attribute style.lineHeight
, but I want to check the actual line-height, without it depending on the existence of a CSS rule.
Assuming the font family and font size are the same, both should output the same line-height:
<div>One line of text</div>
<div>Two <br /> Lines of text</div>
How can I get the line-height of an element with JavaScript?
line-height
, as some inner rule might be overriding it.. Theline-height
is not constant across the document.. – Timeless