17
Jan
在处理网页时,有时需要实现body垂直居中,用CSS的实现代码:
<style type="text/css">
.body{
width:50%; //..宽度可修改为绝对值..//
height:50%;
position: absolute;
overflow: auto;
margin: auto;
top: 0;
bottom: 0;
left:0;
right:0;
}
</style>
.body{
width:50%; //..宽度可修改为绝对值..//
height:50%;
position: absolute;
overflow: auto;
margin: auto;
top: 0;
bottom: 0;
left:0;
right:0;
}
</style>