给一个div绝对定位后,如何让它水平居中

<style>

.footer{position:absolute;left:0;right:0}

</style>

<div classs="footer">

<button>结束</button>

</div>

也就是说只要给你所定位的div的类加上left:0;right:0;(margin:auto;这个好像不加也管用)就可以了!

posted @ 2016-05-06 09:53  夏小夏吖  阅读(1743)  评论(0编辑  收藏  举报