Forum Moderators: not2easy
DIV1 DIV2
DIV1 DIV2
DIV1 ____
DIV1 DIV3
____ DIV3
DIV4 DIV3
DIV4 ____
DIV4 DIV5
DIV4 DIV5
____ DIV5
____ DIV5
I presumed that simply setting the width and floating each div to the left ought to do it <div style="width: 300px; float: left;" /> but instead Firefox gives me:
DIV1 DIV2
DIV1 DIV2
DIV1 ____
DIV1 DIV3
____ DIV3
____ DIV3
____ DIV3
DIV4 ____
DIV4 ____
DIV4 ____
____ ____
____ ____
Div3 lines under Div2 but then Div4 is forced below the bottom of Div3 (as if Div4 was set to clear it).
I'd be grateful if someone could point me in the right direction. I'm sure I'm missing something obvious with regard to floating elements but I can't work out what it is. I've tried looking for info but everything I find is achieving a grid layout with consistent dimensions.
Regards,
John
The right answer will depend on how much you know about the sizes of the divs in advance. A general solution might be quite tricky. Does the order of the divs matter, or do you just want to use the space effectively?
[edited by: alfaguru at 8:00 pm (utc) on Jan. 8, 2007]