I have a div that is float:left, and after the div is the rest of the page. In order to keep the rest of the page below the div, I must first place a
<br clear="all">
Q: How do I position the rest of the page below the floated div? I think that I need to wrap the rest of the page in a new div and float it as well. But I tend to stay away from floats as much as I can.
after the div you've floated. add the following code.
then continue the rest of the page as usual.
I usually wrap another div around the floating div, with style
overflow: auto
On the next item you can use the style
clear:left
.Another alternative is to set the
overflow
style on the parent of the floating element to make it contain it, likeoverflow:hidden
.Create a class and insert into CSS:
Insert into HTML:
This made it past W3 markup and CSS validator.