<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"> <html lang="en"> <head> <title>Margin Collapsing: margins on relative boxes</title> <style type="text/css"> .ahem { display: inline; font: 1em/1 Ahem, sans-serif; background: red; color: white; } div { font: 1em/1 Ahem, sans-serif; } .relative { position: relative; margin: 0 0 5em 0; } .absolute { position: absolute; margin: 0; top: 0; left: 0; color: green; } .static { position: static; margin: 0; color: red; } </style> </head> <body> <div class="relative"> <div class="absolute"> XXXXX </div> </div> <div class="static"> XXXXX </div> <p>There should be no red above.</p> <div class="ahem">Ahem_font_required_for_this_test.</div> </body> </html>