When I use floating itens inside a container, like:
The 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
of the container is not exactly the width of the contents:
There is some empty space on the right. Is there a way to make the container really be the width of the floating children, even when I resize it?