好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

CSS垂直居中方法整理_html/css_WEB-ITnose

CSS定位中常常用到垂直居中,比如覆盖层上的弹框。

兼容性比较好的方法:

    #box{ width:200px; height:100px; text-align:center; position: absolute;  left: 50%; top: 50%; margin-top: -50px;    /* 高度的一半 */ margin-left: -100px;    /* 宽度的一半 */ background-color:#ffff99;}   

Hello World!

查看更多关于CSS垂直居中方法整理_html/css_WEB-ITnose的详细内容...

  阅读:31次