Just started to learn CSS and happened to see some discussion about display:table
for web layout. I made a simple pen in which a two-row layout is created by inline-block and floats respectively. I doubt if display:table
can be used to do this.
.container{
width:500px;
height:200px;
border:1px solid green;
margin:10px;
}
.a, .b {
display:inline-block;
background:grey;
border:1px solid red;
box-sizing:border-box;
vertical-align:top;
}
.a {
width:30%;
height:50%;
}
.b {
width:70%;
height:50%;
}
<div class="container">
<div class="a">a</div>
<div class="b">b</div>
<div class="b">b</div>
<div class="a">a</div>
</div>