Vanilla 1.1.9 is a product of Lussumo. More Information: Documentation, Community Support.
1 to 6 of 6
It seems div#main is not collapsing; it’s using as much space as it’s allowed. This is because your inner items are floating left, which is pushing its container’s edge out as far as it can go in the effort to float. You don’t really have much choice in this matter; either your inner items are allowed to push their parent box out our the parent box is allowed to collapse down to the smallest width it can. In the former situation you will get this gap in the middle, in the latter situation you will get a single column of inner items. Your have a variety of options here:
1. Find a way to make that center column aesthetic, for instance you could give your UL and your #side a solid white background, but have something interesting in the body background with right alignment and an offset of -300px, so that it will fill that column with some kind of visual details and make it not look empty.
2. You can float your li items right; this will allow your #main to collapse properly. That will put them in a rtl, ttb layout though and you probably don’t want that.
3. You can use javascript to dynamically resize #main in multiples of the width of an li item + its margin and padding as your window resizes. That is a fairly easy script, and will solve your problem in probably 99.9% of your trouble cases (not many people will run a modern browser without JS).
function fixWidth() {
var widthInc = 200px; // width of li including margin & padding
var el = document.getElementById('main');
var width = el.offsetWidth;
// divide the current width by the increment, round down, and multiply by the result
// then apply it to the element's style
el.style.width = (Math.floor(width/widthInc) * widthInc)+"px";
}
window.onresize = fixWidth;
main.style.width = Math.min(Math.floor((winWidth-330)/itemWidth) * itemWidth), itemWidth) + "px";
1 to 6 of 6