码迷,mamicode.com
首页 > Web开发 > 详细

CSS3等分div

时间:2016-05-17 22:28:54      阅读:335      评论:0      收藏:0      [点我收藏+]

标签:

技术分享

CSS代码

body,p{margin: 0;}
.parent{display: flex; width:1200px; margin:0 auto;}
.child{flex:1;height: 100px;}
.child + .child{margin-left: 20px;}

Html代码

    <div class="parent" style="background-color: lightgrey;">
        <div class="child" style="background-color: lightblue;">1</div>
        <div class="child" style="background-color: lightgreen;">2</div>
        <div class="child" style="background-color: lightsalmon;">3</div>
        <div class="child" style="background-color: pink;">4</div>
        <div class="child" style="background-color: pink;">5</div>
        <div class="child" style="background-color: pink;">6</div>
    </div>

 

CSS3等分div

标签:

原文地址:http://www.cnblogs.com/jingyong001/p/5503306.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!