Hi, I need a layout using CSS. I am having 3 divs - div1, div2 and div3 I want them positioned like Div1 Div3 Div2 I am not able to do it without using a absolute positioning which I do not need. Can anybody please provide some suggestions what flot/position etc CSS should I apply Thanks in advance
There are a few ways you can do this, but you will have to specify width for all. I recommend the code below. #left { float:left; width:x; } #Div1 { float:left; width:x; } #Div3 { float:left; width:x; } #Div2 { float:left; width:x; } <div id="left"> <div id="Div1"></div> <div id="Div3"></div> </div> <div id="Div2"></div> Code (markup):
thx for reply but i dont have a div with id=left. Nor I can specify width as I do not know the size of contents in the divs.
Then you can just go width:auto or you have to do the math if you want two of the divs to fit next to each other then they have to both add up to 100% of whatever your whole container size is and not over or the second div will move to the next line on it's own. You have to do a little basic math.