好得很程序员自学网

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

css居中_html/css_WEB-ITnose

1、把margin 设为atuo

  margin :简写属性在一个声明中设置所有外边距属性。该属性可以有 1 到 4 个值。

  具体来说就是把要居中的元素的margin-left和margin-right都设为auto,此方法只能进行水平的居中, 且对浮动元素或绝对定位元素无效 。

       margin 居中      #test{   width:50px;   height: 50px;   background-color: blue;   margin: auto;}   

查看更多关于css居中_html/css_WEB-ITnose的详细内容...

  阅读:31次