您的位置:首页 > Web前端 > CSS

CSS div水平垂直居中和div置于底部

2016-06-23 10:21 603 查看
一、水平居中

.hor_center {
margin: 0 auto;
}


二、水平垂直居中

<div class="content"></div>

.content {
width: 360px;
height: 240px;
}
.ver_hor_center {
position: absolute;
top: 50%;
left: 50%;
margin-left: -180px; /*要居中的div的宽度的一半*/
margin-top: -120px; /*要居中的div的高度的一半*/
}


三、div置于底部(footer)

.bottom_footer {
position: fixed; /*or前面的是absolute就可以用*/
bottom: 0px;
}


来自:http://blog.csdn.net/sykent/article/details/7791284
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: