I had a following simple html code:
Code: Select all
<div style="width:100%;border:1px solid green;">
<div style="float:left;border:solid 1px blue"> on the left </div>
</div>
I tried adding div style="clear:both"... just after the left-floating div but it didn't work either.
After trial and error, adding br style="clear:both" finally worked:
Code: Select all
<div style="width:100%;border:1px solid green;">
<div style="float:left;border:solid 1px blue"> on the left </div>
<br style="clear:both" />
</div>
p.s. I have another code where div style="clear:both" works fine and does the job - why in this particular case I need to use br style="clear both". I would love to finally understand the way divs work...