Why in the following code .height() returns 95 rather than 100, while .width() returns 200 as expected ? I work with Firefox 3.6.3.
HTML:
<table><tr>
<td id="my"></td>
</tr></table>
<div id="log"></div>
CSS:
#my {
border: 5px solid red;
}
JS:
$("#my").width(200).height(100);
$("#log").append("Width = " + $("#my").width() + "<br />");
$("#log").append("Height = " + $("#my").height());
I tried .outerWidth() and .outerHeight() and also .innerWidth() and .innerHeight(), but none of them returns the expected result: code example
But, if I set position: absolute
it looks much better !
Can anyone explain this behavior ?