天天看點

怎樣使一個層垂直居中于浏覽器中

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml: >
<head profile="http://www.w3.org/2000/08/w3c-synd/#">
<meta http-equiv="content-language" content="zh-cn" />
<meta http-equiv="content-type" content="text/html;charset=gb2312" />
<title>blueidea</title>
<style type="text/css">
/*<![CDATA[*/
div {
 position:absolute;
 top:50%;
 left:50%;
 margin:-100px 0 0 -100px;
 width:200px;
 height:200px;
 border:1px solid red;
 }
/*]]>*/
</style>
</head>
<body>
<div>web????甯歌???棰?澶у??lt;/div>
</body>
</html>