Ticket #11616 (closed bug: invalid)
outerHeight not properly calculated when children have margins
| Reported by: | willemmulder@… | Owned by: | |
|---|---|---|---|
| Priority: | low | Milestone: | None |
| Component: | dimensions | Version: | 1.7.2 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
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
comment:1 Changed 13 months ago by rwaldron
- Priority changed from undecided to low
- Resolution set to invalid
- Status changed from new to closed
- Component changed from unfiled to dimensions
comment:3 Changed 13 months ago by anonymous
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?
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

This is not a jQuery bug, the outer element has a height of only 20px:
http://jsfiddle.net/rwaldron/dYkjN/