Why in the following code .hight () returns 95, not 100, and .width () returns 200, as expected? I am working 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 (), as well as .innerWidth () and .innerHeight (), but none of them return the expected result: code example
But, if I set position: absolute , it looks much better !
Can anyone explain this behavior?
javascript jquery html css
Misha moroshko
source share