| <!DOCTYPE html> |
| <!-- |
| | Adjoining vertical margins collapse if both belong to vertically-adjacent box |
| | edges, i.e. bottom margin of box and top margin of its next in-flow following |
| | sibling. |
| | https://www.w3.org/TR/CSS21/box.html#collapsing-margins |
| --> |
| <html> |
| <head> |
| <style> |
| .blue { |
| background-color: #2196f3; |
| height: 100px; |
| margin-bottom: 50px; |
| width: 100px; |
| } |
| .indigo { |
| background-color: #3f51b5; |
| height: 100px; |
| margin-top: 50px; |
| width: 100px; |
| } |
| </style> |
| </head> |
| <body> |
| <div class="blue"></div><div class="indigo"></div> |
| </body> |
| </html> |