| <!DOCTYPE html> | |
| <!-- | |
| | Adjoining vertical margins collapse if both belong to vertically-adjacent box | |
| | edges, i.e. top and bottom margins of a box that has no in-flow children. | |
| | https://www.w3.org/TR/CSS21/box.html#collapsing-margins | |
| --> | |
| <!-- TODO: Test for a box that does/does not establish a new block formatting | |
| context and that has/does not have zero computed 'min-height', zero | |
| or 'auto' computed 'height', and no in-flow children. --> | |
| <html> | |
| <head> | |
| <style> | |
| .blue { | |
| background-color: #2196f3; | |
| height: 100px; | |
| width: 100px; | |
| } | |
| .empty { | |
| margin-top: 50px; | |
| margin-bottom: 100px; | |
| } | |
| .indigo { | |
| background-color: #3f51b5; | |
| height: 100px; | |
| width: 100px; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <div class="blue"></div> | |
| <div class="empty"></div> | |
| <div class="indigo"></div> | |
| </body> | |
| </html> |