1 (edited by pedrotuga 2007-12-06 02:14)

Topic: two columns (divs) inside another div

Ok, aparently there is a bug that doens't allow this


.main{
width:500px;
margin:auto;
}

.left{
width:270px;
fload:left;
}

.right{
width:150px;
float:right;
}
<div class="main">
<div class="left"></div>
<div class="right"></div>
</div>


The right div wont show as a sidebar, instead it goes under the left one.
What's the workaround i should go for?

2

Re: two columns (divs) inside another div

No workaround, just get the css right. You don't say what the widths are, pixels, em's etc. The widths of the two floats add up to more than the width of the container so they are bound to wrap.

3 (edited by pedrotuga 2007-12-06 13:25)

Re: two columns (divs) inside another div

ops... i put this up to quickly i didn't even notice those bugs.

Well, but this is just an example i put up. Fact is: the (corrected) code above does not render properly.

sorry for messing it up more in the first post.

EDIT:solved. For some reason it only renders properly when the division on the right comes first on the html... weird.