When I use float itens inside a container, for example:
Code ( http://jsfiddle.net/tombrito/gx7kL330/7/ ):
.container { background: blue; position: absolute; width: auto; } .floating-box { float: left; width: 150px; height: 75px; margin: 10px; border: 3px solid #73AD21; }
<div class="container"> <div class="floating-box">Floating box</div> <div class="floating-box">Floating box</div> <div class="floating-box">Floating box</div> <div class="floating-box">Floating box</div> <div class="floating-box">Floating box</div> <div class="floating-box">Floating box</div> <div class="floating-box">Floating box</div> <div class="floating-box">Floating box</div> </div>
... if I resize the window, I see that the width: auto container is not exactly the width of the content:

There is an empty space on the right side. Is there a way to make the container really wide as floating children, even when I resize it?
source share