直接上DEMO了
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <style type="text/css"> <!-- .d1 { position:absolute; top:20px; left:20px; width:200px; height:200px; background:red } .d2 { width:500px; height:100px; background:blue; } --> </style> <div class="d1"></div> <div class="d2"></div>