View Full Version : CSS: clear:both only inside parent div

12-25-2003, 09:27 AM
I use floating divs for the left and right columns of my site, and put my actual content in the main centre content div. Now, in this div I float pictures right in my review section.

If I want to put something below the floated picture by using clear:both, this clears the picture and my left and right columns, which is obviously not good!

Anyone know how to restrict the clear:both attribute to just the div that the float is in?

02-27-2004, 03:42 AM
No - but I'd also really like to know if this is possible...


02-27-2004, 04:03 AM
Actually, after a few minutes googling, I've found that complexspiral have an interesting solution to this one:


See the paragraph headed "Set a Float to Fix a Float"

Hope it helps


02-27-2004, 05:44 AM
Excellent cheers, will have a go at that tonight! Welcome to Web Pub :)