<html> <title>XXXX</title> <meta charset="utf-8" /> <style type="text/css"> *{ margin:0px; padding:0px; } #content{ width:400px; height:600px; border:1px solid red; /*边框样式*/ position:absolute; top:50%; left:50%; margin-top:-300px; /* -301px;*/ margin-left:-200px; /*-201px*/ } </style> <body> <div id="content"> ...... </div> </body> </html>