Bug Tracker

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#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:
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 7 years ago by Rick Waldron

Component: unfileddimensions
Priority: undecidedlow
Resolution: invalid
Status: newclosed

This is not a jQuery bug, the outer element has a height of only 20px:

http://jsfiddle.net/rwaldron/dYkjN/

comment:3 Changed 7 years 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?

comment:4 Changed 7 years ago by dmethvin

Your answers won't be found in a bug tracker. Try a forum.

comment:5 Changed 7 years ago by anonymous

True, I'll try there :-) Thanks!

Note: See TracTickets for help on using tickets.