You will need to make some adjustments to your CSS code:
#content{
height:100%;
width:100%;
left:0;
top:0;
position:absolute;
}
.box{
line-height:22px;
}
After reviewing your goal, it seems that JavaScript is necessary for achieving the desired outcome. However, keep the CSS structure similar to the provided example to ensure a visually appealing loading experience.
$(document).ready(function(){
var actualContentWidth = $("#content").width();
var boxes = $("#content .box").length;
var newWidth = boxes * actualContentWidth;
newWidth += "px";
$("#content").css({width:newWidth });
$("#content .box").css({width:actualContentWidth + "px",float:'left'});
});
If you wish for the content to resize when the window size changes:
function reCalculateSizes(){
$("#content").css({width:"100%"});
var actualContentWidth = $("#content").width();
var boxes = $("#content .box").length;
var newWidth = boxes * actualContentWidth;
newWidth += "px";
$("#content").css({width:newWidth });
$("#content .box").css({width:actualContentWidth + "px",float:'left'});
}
$(document).ready(reCalculateSizes);
$(window).resize(reCalculateSizes);