<style type="text/css">
#box{width:600px; height:400px; border:1px solid red;}
#box{position:static; *position:relative; display:table; *display:block; }
#box-middle{position:static; *position:absolute; display:table-cell; *display:block; *top:50%; vertical-align:middle; *vertical-align:auto;}
#box-inner{*position:relative; *top:-50%; background-color:blue; margin:0 auto; width:200px; height:100px;}
</style>
<div id="box">
<div id="box-middle">
<div id="box-inner">content</div>
</div>
</div>
posted on 2008-12-04 17:23
汪杰 阅读(192)
评论(0) 编辑 收藏 引用 所属分类:
divandcss