margin:auto;实现垂直居中

代码:
http://jsbin.com/gesupehoxa/edit?html,css,output

绝对定位absolute与margin实现上下左右居中(仅支持IE8+)
http://jsbin.com/xucarafaji/edit?html,css,output

CSS margin负值定位

解决方案:
http://jsbin.com/kecocisude/edit?html,css,output

margin负值定位的巧妙用法2:(IE6都支持)
填充空余区域:

http://jsbin.com/gorekeviyo/edit?html,css,output

 

posted on 2016-07-13 22:29  Asina  阅读(218)  评论(0编辑  收藏  举报