I'm having an issue getting a DIV to resize to fit the content when it forces its child divs to move down.
What I'm trying to do in the sample is have the container div's width to that of the children so that I can have the container centered on the page.
HTML
<div id="container">
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
</div>
CSS
body {
text-align: center;
}
#container {
text-align: left;
border: 1px solid red;
display: inline-block;
padding:0;
margin:0;
/* for ie6/7: */
*display: inline;
}
.box{
width: 100px;
height: 100px;
border: 1px solid blue;
display:inline-block;
}
When you look at the example the container is expanding to 100% while leaving space between right most child and the container.
http://jsfiddle.net/rjY7F/594/