I've encountered this problem before and have not really found a solution. I have this html (simplified):
<div class="outer">
<header>my header section</header>
<div id="body">
<h1>Page H1</h1>
<p class="content"></p>
</div>
<footer>footer section</footer>
</div>
And I'm trying to get the actual height of #body (using jQuery) like this:
var b = $('#body').outerHeight(true);
But that is not returning what I think is the correct height. The height I expect is the height that FireFox also reports in the "Box Model" (in Developer Tools). But jQuery is returning a different value, which appears to exclude the top margin of the h1 tag.
I also tried to use innerHeight of #body but it returns the same value. Anyone has an idea of how to do it, hopefully without having to iterate through the child elements?
I have this fiddle for your reference.