<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> New Document </title>
<meta name="Generator" content="text/html;charset='utf-8'">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
</head>
<style>
.container{
width:200px;
height:200px;
background:red;
position:absolute;
left:50%;
top:50%;
margin-left:-100px;
margin-top:-100px;
border-radius:100px;
line-height:200px;
text-align:center;
}
</style>
<body>
<div class="container">
div居中显示
</div>
</body>
</html>
<html>
<head>
<title> New Document </title>
<meta name="Generator" content="text/html;charset='utf-8'">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
</head>
<style>
.container{
width:200px;
height:200px;
background:red;
position:absolute;
left:50%;
top:50%;
margin-left:-100px;
margin-top:-100px;
border-radius:100px;
line-height:200px;
text-align:center;
}
</style>
<body>
<div class="container">
div居中显示
</div>
</body>
</html>