<html>
<head>
<style>
body{TEXT-ALIGN: center;}
#center{ MARGIN-RIGHT: auto;
MARGIN-LEFT: auto;
height:200px;
background:blue;
width:400px;
vertical-align:middle;
line-height:200px;
}
p{
color:#CF6;}
</style>
</head>
<body >
<div id="center"><p>大家好</p></div>
</body>
</html>
<head>
<style>
body{TEXT-ALIGN: center;}
#center{ MARGIN-RIGHT: auto;
MARGIN-LEFT: auto;
height:200px;
background:blue;
width:400px;
vertical-align:middle;
line-height:200px;
}
p{
color:#CF6;}
</style>
</head>
<body >
<div id="center"><p>大家好</p></div>
</body>
</html>