<style type="text/css"> .d1 { 120px; height: 360px; background: #ccc; position: fixed; top: 120px; left: 10px; } .d2 { 120px; height: 360px; background: red; position: fixed; top: 120px; right: 10px; } </style>