I have a centred div with floating elements in it, each element has the same height and width and is floating. When the div is resized, there is always a gap on the right side where there isnt enough space to fit another element. What I want is for the div to only expand when it can fit another element rather than just have a space there. Is that possible?

I have a centred div with floating elements in it, each element has the
Share
CSS3 Solution
Using some
@mediaquery calls (so there is a practical limit to how large one might want to go), yields a good result on CSS3 browsers. See this fiddle (full screen), which uses this (just for example) code:HTML
CSS
Also, it is possible that you or other users might find this helpful.