今天新学的,也许还有很多其他方法。
<html><style>
.div01{width:100%; height:100%; position:relative;}
.div02{background:#FF0000; color:#FFFFFF; position:absolute; left:50%; top:50%; margin:-100px 0 0 -100px; width:200px; height:200px;}
</style>
<body><div class="div01">
<div class="div02">老子绝对在中间!</div>
</div></body>
</html>
</style>
<body><div class="div01">
</div></body>
</html>