不废话,直接代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title></title> <style> body{ min-width:960px;} .main{ margin-top:5px;overflow:hidden;} .top,.left,.right,.foot{border:1px solid grey;} .top{height:100px;} .left{ width:200px; float:left; height:200px;} .right{ height:500px; margin-left:220px;} </style> </head> <body> <div class="top">top</div> <div class="main"> <div class="left">left</div> <div class="right">right</div> </div> </body> </html>
呵呵,简单吧,需要注意的是.right的样式中没有float也没有width。