I have the following html structure:
<div id="container">
<h1>This is an h1 element</h1>
</div>
When I try to find the height of the container in firefox or chrome div using javascript:
var container = document.getElementById("container");
var offsetHeight = container.offsetHeight;
I get the wrong offsetHeight (also if used with clientHeight). I get only the height of the H1 itself and not the margin-before/margin-after that surround the element.
is there any way to get the real height?