Click to See Complete Forum and Search --> : [RESOLVED] CSS float problem
trivektor
04-15-2008, 09:55 PM
Hi. Please take a look at this page http://tri.phongnguyen.net/olwin/styles2.html On the right I have 3 divs (i.e wind 1). All of them are floated left. However, when I put a 'clear:both' div below them (to make sure that the div contains them are expanded properly), 'section 2' is pushed down really far away. I used the same trick for the right, but nothing went wrong. Can anyone please help? Thanks.
Centauri
04-15-2008, 10:39 PM
As the entire left column is a float, any clears in the right column will also clear the left column. If the contents of the right column themselves are enclosed in a float, the clear does not extend outside it. Youi seem to have a lot of divs there, but one of them can be utilised as a 100% width floated wrapper: <div style="margin-left: 500px; padding-left: 20px;">
<div style="float:left; width: 100%;">
<div>
<div class="windowstyle1">wind 1</div>
<div class="windowstyle1">wind 1</div>
<div class="windowstyle1">wind 1</div>
</div>
<div class="clearing"></div>
</div>
<div>
section 2
</div>
trivektor
04-15-2008, 10:49 PM
Thanks so much Centauri.