fordie’s blog

20 Mar, 2007

Ffffffliping floats!

Posted by: Mark In: aide-mémoire| css| web development

I’ve been having various problems over the past few days with CSS floats. more specifically, either background images on containing elements not appearing or floated elements acting as if they’ve run out of room in the parent element and dropping down on to “the next line”.

The cause of this is the fact that I haven’t cleared the float before closing the containing element. I have found two ways of curing the problem.

  1. Clear the float.
  2. set a min-height on the parent (containing) element. Remembering of course to add a height in your IE specific stylesheet.

This is pretty basic stuff, but it’s been a while since I’ve hit a problem like this in CSS so it makes sense for me to blog it to help me remember next time; and who knows it might help someone else too.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • StumbleUpon
  • Technorati

No Responses to "Ffffffliping floats!"

Comment Form

Flickr PhotoStream

    witch oneWitches of West Worthingbecause the internets need more kitteh picturesInteresting pub vending machine

fordie, elsewhere:

if you're an internet stalker these would be good sites for you to stalk me on…


Latest Tweet