Msg#: 4656839 posted 6:24 pm on Mar 24, 2014 (gmt 0)
Annoying as it may be, I expect that in the end it will come down to browsers having different defaults for different <!DOCTYPE>s - especially for the HTML and BODY elements. In any case, the solution is straightforward enough.
Msg#: 4656839 posted 11:24 pm on Mar 24, 2014 (gmt 0)
HTML5 is a specification, not an application, so, no, it's not a bug in HTML5. But no one should be using the transitional doctype for new web pages since 1999 so I don't know why the comparison is being made.
Without checking, I'd bet the difference is caused between the values of textContent and clientHeight.
Msg#: 4656839 posted 11:23 am on Mar 25, 2014 (gmt 0)
Forget my last line about textContent. It does change with the doctype so that statement doesn't make sense. I'm not surprised the doctype causes the change but it's been so long since I've had to deal with those issues that I don't remember and it's not worth remembering for the reason I stated, no one should be using a transitional doctype for new web pages.
Msg#: 4656839 posted 4:21 pm on Mar 25, 2014 (gmt 0)
You're seeing the line-height of the <div>. Since you haven't specified a line-height, the browser will default to "normal", and the value of "normal" is browser defined. Many browsers use 1.2 of the font-size. Perhaps "normal" was different in HTML4.01 loose. In any case, if you want/need a fixed line-height, then declare it in your CSS.