<!DOCTYPE html> <html> <head> <style type="text/css"> #a { background-color: green; margin-bottom: 40px; } #a div { height: 20px; margin-bottom: 10px; } #b { height: 20px; background-color: green; margin-top: 20px; } </style> </head> <body> <div id="a"> <div></div> </div> <div id="b"> </div> </body> </html>