When I create a parent container div with three child divs and set the display property to inline-block, everything looks great on jsfiddle
CSS
#container {
border: 1px solid blue;
padding: 2px;
display: inline-block;
}
.child {
width: 100px;
border: 1px solid black;
float: left;
margin: 2px;
}
HTML
<div id="container">
<div class="child">child 1</div>
<div class="child">child 2</div>
<div class="child">child 3</div>
</div>
It works perfectly until I have a larger number of children (like 30) and then things start going wrong on jsfiddle
What's causing this white-space issue, and how can I make the container div size down properly?