[class*='col-'] {
height: 20px;
position: relative;
float: left;
}
[class*='col-'] +[class*='col-'] {
margin-left: 1.6%;
}
.row, [class*='col-'] {
box-sizing: border-box;
}
.row:before, .row:after {
content:" ";
display: table;
}
.row:after {
clear: both;
}
.col-4 {
background-color: red;
width: 32.2666666667%;
}
.col-6 {
background-color: green;
width: 49.2%;
}
.col-8 {
background-color: red;
width: 66.1333%;
}
#d6{
margin:0%;
}
#d8{
margin:0%;
}
and then your html:
<div class="row">
<div class="col-4"></div>
<div class="col-4"></div>
<div class="col-4"></div>
<div id="d6" class="col-6"></div>
<div id="d8" class="col-8"></div>
</div>
Flexbox是你的朋友。 – 2015-10-18 04:58:17