September 3, 2004 at 3:35PM Floats fixed forever!
I had an epiphany last night. I was looking at Position Is Everything last night and I found an article detailing the Peekaboo bug.
This is something that’s plagued me for a long time. In the previous talideon.com, text in the page would disappear for no good reason, leaving me to scratch my head in puzzlement.
What I discovered from the page was that if you put a width on the divs in question, this goes away.
But it doesn’t stop there, and here’s where the post title comes in. I discovered from the site that there’s a rather useful bug in IE where if an element contains floats and has a width on it, its height will automatically expand to clear those divs. Woohoo! But what about other browsers?
For that, there’s the good old after pseudoattribute It lets you bung in extra content into the element it’s applied to. I’m not going to detail it here (mainly because I need to add preformatted blocks to my formatting code), but you can read about doing it here. The nifty thing about all this is that you no longer have to clog up your pages with cruft to clear them.
No comments.