May 18

Clearing floats

2004 at 02.33 am posted by Veerle Pieters

A few weeks ago I posted an article about the collapsing effect you get when a float is contained within a container box that has a visible background and how you can solve this problem. It seems that there is a smatter solution that involves no extra code in the HTML to solve this.

I’ve found an interesting article on how to clear floats without structural markup. This page explains why this effect happens and how to solve it in both the “old-fashion” way (using “clear:both” and 1 line of HTML code) or the smarter way (no HTML code needed) using the :after CSS 2 property.


1served

gravatar

1

permalink this comment travis Tue May 18, 2004 at 09.29 am

Well that is interesting.  It’s a neat approach.  Thanks for sharing it!



Commenting is not available in this weblog entry.

Flickrness

buy something from my Amazon wishlist