PDA

View Full Version : DIVs floating next to each other without a wrap!



vxdom
October 20th, 2007, 08:05 AM
Hello guys,

I'm trying to create a design based around this:

http://www.skatebasingstoke.com/x/

But, I want the light green divs to always be next to each other, currently they wrap if the page is too narrow, whereas I want a horizontal scrollbar to appear.

The only way I've came around this is to add a fixed width accordingly to the yellow container they're in, but I can't use this because the number of light green DIVs will vary! Sometimes there will be 9, sometimes 12, or 25! etc...

Any help?

MTsoul
October 20th, 2007, 12:51 PM
There really isn't a way to do this without javascript... Any kind of elements will go to the next line if it doesn't fit on the current line.

What you could do is put each consequetive div in the previous one, so it becomes a tree structure. That way it is one huge div to the browser, but it is also separated. For the css, you could set the overflow to visible, and position to relative, and left to the width of the div. That way, each div is relatively pushed to the right a certain amount.