CSS - 如何使用没有任何空间的float

时间:2015-09-06 14:50:59

标签: html css

我在一个容器内有许多不同高度的浮动物品 我想要的物品将填充容器,没有任何空格(白色区域) 但它不适合我。

我在下面的小提琴上有代码:

https://jsfiddle.net/bhvgctsm/1/



body {
   width : 400px;
}

.div100 {
    float: right;
    height : 60px;
    width :48%;
    background-color : red;
    border : 1px solid black;
}
.div200 {
    float: right;
    height : 100px;
    width :48%;
    background-color : blue;
        border : 1px solid black;
}

.left {
    float : left;
    width : 48%;
}

<body>
    <div class="left">
        <div class="div100"></div>
        <div class="div200"></div>
        <div class="div200"></div>
        <div class="div100"></div>
        <div class="div200"></div>
    </div>
</body>
&#13;
&#13;
&#13;

0 个答案:

没有答案