I was wondering if it was possible to make my wrapper div scale around its floated child divs (.box) tightly when the browser is resized. At the moment, if the browser is resized the 4th div will go on to the next line however the wrapper div will stay the same size as though it is still there but I want it to scale down so it fits perfectly around the 3 divs left if that makes sense...How would I achieve this?
jsFiddle - http://jsfiddle.net/JCGj6/
<div class="showcase_wrapper">
<div class="showcase" id="pt1">
<div class="inner">
<div class="box"> One </div>
<div class="box"> Two </div>
<div class="box"> Three </div>
<div class="box"> Four </div>
</div>
</div>
</div>
.inner {
position:relative;
}
.showcase_wrapper {
margin:170px auto 0px auto;
max-width:848px;
position:relative;
}
.showcase {
position:absolute;
top:0;
width:100%;
min-width:424px;
display:inline-block;
white-space:normal;
float:left;
z-index:0;
border:1px solid #ff0000;
background:#ff000;
}
.showcase .box {
position:relative;
background:#ff0000;
width:212px;
height:173px;
float:left;
cursor:pointer;
}