I have two inline-blocks of fixed content, I'm trying to display these next to each other.
They're both held within a div of width: 1000px;
, the two inline-block divs are both width: 400px;
and width: 600px;
respectively.
The two divs however don't display inline, the second div collapses underneath the first, if I drop the width of the second to width: 550px;
they both display inline, my question being:
How come two divisions that have a combined width of 1000px
can't both fit inside a container that has a width of 1000px;
?
Fiddle below.
<div class="layout">
<div class="width">
<div class="area left">
</div>
<div class="area right">
</div>
</div>
</div>
And the CSS
.layout {
box-sizing: border-box;
padding-left: 250px;
padding-right: 250px;
padding-top: 50px;
}
.layout .area.left, .layout .area.right {
display: inline-block;
height: 250px;
}
.layout .area.left {
width: 400px;
background: green;
}
.layout .area.right {
width: 600px;
background: blue;
}
.width {
width: 1000px;
margin: 0 auto;
}