div垂直居中

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
<!--
*{margin:0;padding:0;font-size:12px;color:#fff;}
.aa{600px;height:500px; background:#000;margin:0 auto;}
#edge,#container{display:table-cell;*display:inline; zoom:1;text-align:center;vertical-align:middle;600px;}
#edge{1px;margin-left:-1px;height:500px;}
-->
</style>
</head>
<body>
<div class="aa">
        <div id="edge"></div>
        <div id="container">
            <img src="http://ikshow.com/demo/vertical-middle/1.jpg" />
            <p>无标题文档无标题文档无标题文档无标题文档无标题文档无标题文档</p>
            <p>无标题文档无标题文档无标题文档无标题文档无标题文档无标题文档</p>
            <p>无标题文档无标题文档无标题文档无标题文档无标题文档无标题文档</p>
            <p>无标题文档无标题文档无标题文档无标题文档无标题文档无标题文档</p>
            <p>无标题文档无标题文档无标题文档无标题文档无标题文档无标题文档</p>
        </div>
    </div></body>
</html>
原文地址:https://www.cnblogs.com/Randy0528/p/937561.html