解决上下左右都居中的div图层,高度和宽度确定的情况下,
<html >
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312" />
<meta name="author" content="Smiling Dolphin" />
<meta name="keywords" content="azhong.com" />
<meta name="description" content="my favorites language." />
<meta name="robots" content="all" />
<title>解决上下左右都居中的div图层 css</title>
<style type="text/css" title="currentStyle" media="screen">
#center{
position:absolute;
top:50%;
left:50%;
margin-top:-200px;
margin-left:-300px;
width:600px;
height:400px;
border:1px solid #333333;
}
</style>
</head>
<body>
<div id="center">
margin-top:-200px;
margin-left:-300px;重点
width:600px;
height:400px;
这个就是利用参数的倍数关系!,主要倍数的关系
,不过感觉如果扎们高度不确定的情况下怎么半了,哦我也不知道了,
</div>
</body>
</html>