User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322) Build Identifier: (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040803 When we set the border pixel, style and color from a div element the height of this div ignore this border for you offsetheight. The same style applied in a table have a correct behavior Reproducible: Always Steps to Reproduce: 1.Open page http://www.sengir.hpg.ig.com.br/DivError.htm 2.Look at 2 first shapes in the html, they are the divs with the problem 3. Actual Results: The <div> element with the border will have a size bigger than the defined height Expected Results: The <div> element must have the size defined in the height
This is invalid. "height" does not include the border and padding in CSS. For tables, Mozilla uses "-moz-box-sizing: border-box" for backwards-compat reasons.
But how I make the Div have the same behavior that the Table? I think that all mozilla and stylesheet must have the same behavior for all elements. See the url http://www.sengir.hpg.ig.com.br/DivError.htm, the same stylesheet is applied for a DIV and a TABLE and the layout is different.
Thanks for the hint of apply "-moz-box-sizing:border-box;". I reopened the bug just for question if different behavior is a good think. Thank again
Yes. The behavior is VERY intentional.