让两个DIV居中显示

下面是源代码:
<style>
div {
position:absolute;
top:50%;
left:50%;
margin:-100px 0 0 -120px;
}
</style>
<div style="background:#404040;width:120px;height:200px;"></div>
<div style="background:#FD7C03;width:120px;height:200px;margin:-100px 0 0 0px;"></div>

 

posted @ 2010-10-27 11:22  老皮肉  阅读(905)  评论(0编辑  收藏  举报