CSS: 水平居中

使用"margin: auto;"将一个元素在父元素中上下左右居中。

如果只是在水平方向居中,使用如下格式:

    margin: 10px auto 20px; //其中,10px是top,20px是bottom

posted on 2014-04-04 06:21  橡皮鱼  阅读(144)  评论(0编辑  收藏  举报