#11616 closed bug (invalid)
outerHeight not properly calculated when children have margins
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | low | Milestone: | None |
Component: | dimensions | Version: | 1.7.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
I have created a JSFiddle here which illustrates best what I try to explain here: http://jsfiddle.net/pgjwG/4/
Basically, when there is a container div with children, and the children have a margin, then outerHeight(true) returns an incorrect value for the container div. It will return the height as if the top-margin of the top-child and the bottom-margin of the bottom-child would not apply.
Change History (5)
comment:1 Changed 11 years ago by
Component: | unfiled → dimensions |
---|---|
Priority: | undecided → low |
Resolution: | → invalid |
Status: | new → closed |
comment:3 Changed 11 years ago by
I see that it's not jQuery's problem, but I still don't really understand why the browser only returns 20px... The margins of the inner elements 'move' to the parent element? Then still the parent would have the 60px if it includes its margins, right? Why are the margins of both the parent itself and the children not taken into account when the browsers calculates its height?
This is not a jQuery bug, the outer element has a height of only 20px:
http://jsfiddle.net/rwaldron/dYkjN/