This course will become read-only in the near future. Tell us at community.p2pu.org if that is a problem.

Key Concepts [Jan. 23, 2012, 11:50 p.m.]


Margin Collapsing

Top and bottom margins of blocks are sometimes combined (collapsed) into a single margin whose size is the largest of the margins combined into it, a behavior known as margin collapsing.

For example:

#section1 { margin: 1.5em 0 0; } /* top, right/left, bottom */

#section2 { margin: 2.5em 0 0; } /* top, right/left, bottom */

The winnning margin where the two sections separate is 2.5em because it is the largest value.