<!DOCTYPE html> <html> <head> <style type="text/css"> body { margin: 0; } .red { background-color: red; } .green { background-color: green; } .d1 { position: absolute; width: 400px; height: 400px; } .d2 { position: absolute; left: 400px; top: 80px; width: 300px; height: 300px; } </style> </head> <body> <div class="d1 red"></div> <div class="d2 green"></div> </body> </html>