In the code below (fiddle here: https://jsfiddle.net/tno3n3cq/), I expect to see a single row with two columns. Instead I see two rows.
I expect to see a single row because:
- the left side and right side elements are display: inline-block, so they should not be placed on their own line.
- the widths of the two sides add up to the width of the container, so they should both fit on one line.
Where is my reasoning wrong?
* {
box-sizing: border-box;
}
.filelist {
width: 500px;
}
.bem-file {
height: 37px;
}
.bem-left-side {
width: 300px;
display: inline-block;
}
.bem-right-side {
width: 200px;
display: inline-block;
}
<div class="filelist">
<div class="bem-file">
<div class="bem-left-side">
left
</div>
<div class="bem-right-side">
right
</div>
</div>
</div>