parent (blue outline) has no max-height
collapsed margin is the distance between blue and green borders

1em

2.9em

3em

3.1em

5em

parent (blue outline) has max-height of 3em in each test
collapsed margin is the distance between blue and green borders

1em

2.9em

3em

3.1em

5em