Struppi: margin-top, will nicht wie ich es will

Beitrag lesen

Warum zieht der margin-top: 20px im unteren DIV nicht an? Erst wenn ich dass auch noch floate geht es. Jemand eine Erklärung?

Ja: http://www.positioniseverything.net/easyclearing.html

oder hier http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&postId=104&productId=1

Dort wird hier hin verlinkt

Wo so was steht (aber mein englisch ist nicht ausgereift genug, um das wirklich zu verstehen, aber ich vermute es hat etwas mit deiner Frage zu tun)

Computing the clearance of an element on which 'clear' is set is done by first determining the hypothetical position of the element's top border edge within its parent block. This position is determined after the top margin of the element has been collapsed with previous adjacent margins (including the top margin of the parent block).

If this hypothetical position of the element's top border edge is not past the relevant floats, then its clearance must be set to the greater of:

1. The amount necessary to place the border edge of the block even with the bottom outer edge of the lowest float that is to be cleared.
  2. The amount necessary to make the sum of the following equal to the distance to which these margins collapsed when the hypothetical position was calculated:
         * the margins collapsing above the clearance
         * the clearance itself
         * if the block's own margins collapse together: the block's top margin
         * if the block's own margins do not collapse together: the margins collapsing below the clearance

Struppi.