[导入]css控制div居中
div永远居中css也能控制
<style type="text/css">
<!--
#center {
position:absolute;
width:300px;
height:60px;
left:50%;
top:50%;
z-index:1;
background-color:#000;
color:fff;
margin-left:-150px;
margin-top:-32px
}
</style>
</head>
<body>
<div id="center">永远居中</div>
</body>
<!--
#center {
position:absolute;
width:300px;
height:60px;
left:50%;
top:50%;
z-index:1;
background-color:#000;
color:fff;
margin-left:-150px;
margin-top:-32px
}
</style>
</head>
<body>
<div id="center">永远居中</div>
</body>
文章来源:http://www.cnblogs.com/suiqirui19872005/archive/2007/05/14/745844.html