好得很程序员自学网

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

我对Flexbox布局模式的理解_html/css_WEB-ITnose

Flexbox,一种CSS3的布局模式,也叫做弹性盒子模型,用来为盒装模型提供最大的灵活性。首先举一个栗子,之前我们是这样实现一个div盒子水平垂直居中的。在知道对象高宽的情况下,对居中元素绝对百分比定位,然后通过margin偏移的方式来实现。

     .container{        width: 600px;        height: 400px;        border: 1px solid #000;        position: relative;    }    .box{        width: 200px;        height: 100px;        border: 1px solid #000;        position: absolute;        left: 50%;        top: 50%;        margin-left: -100px;        margin-top:-50px;    } 

查看更多关于我对Flexbox布局模式的理解_html/css_WEB-ITnose的详细内容...

  阅读:27次