Internet Explorer 6 Disappearing Content Bug
I don’t like Internet Explorer. I don’t think I’ve made that any secret. One of the reasons for that is that there are many instances where fully valid code won’t render properly in IE6 — many more instances than is the case with other browsers.

IE6 Showing its True Malevolent Self
Today I found the strangest and most terrible bug I’ve ever encountered. In Internet Explorer 6, my main content was completely invisible. Images and text alike were simply gone! The container DIV was stretched out as it would be if the content were there, and the text was selectable! If I highlighted the text, in fact, I was able to see it, even after de-selecting it. On a page refresh however, my content would simply disappear again, only to reappear when highlighted.
I consider this the most terrible bug ever because in most cases, a bug will rearrange your website, or make it look ugly, but users will still be able to access the content. The content is the reason for the site’s existence, and with this disappearing content bug, users of Internet Explorer 6 will not see your content unless they think to highlight it (and in that particular demographic, I’m willing to bet the odds of that are pretty low). Thus your entire site is rendered unusable and pointless. So read on for the fix!
It took only a small amount of research to get to the bottom of it — for what else could one call this bug, besides the IE6 Disappearing Content Bug? It is exactly as you might have guessed, a simply programming oversight, a glitch in the matrix, if you will. From my research no one has ever fully determined the cause, but essentially the use of floats in certain instances will cause your content to hide itself.
The Fix
It was simple enough to fix the bug, and ensure that my content was not hidden, did not disappear, and rendered properly in all circumstances (that I was able to test, anyway). First I applied position:relative; to the DIV that contained my content. Note that the DIV itself was not floated, though there were some floated divs inside of it. Which brings me to the next step, for now that my text was showing up, the floated elements below it which had previously appeared just fine were now hidden. So I tried the same thing again, applying position:relative; to the floated DIVs themselves. Worked like a charm!
In my instance, things all worked out okay like this, and if it’s possible, your disappearing content problems should be solved by applying position:relative; to all affected DIVs or other elements (as far as I know, DIVs are most common). But what if the DIV or element with hidden content is required to be positioned differently than relative? Well, I found a page that described a few other workarounds, although I haven’t tested them myself. Here they are:
The first of these includes wrapping paragraph tags around your floated elements. Yet again, this can cause problems sometimes. Putting an extra paragraph tag is also unfortunate, as it adds an unnecessary and unmeaningful element to the page, which is always a bad thing if semantics are important to you (and they should be, but that’s a topic for another day).
The final workaround I found involves removing the background property from upper-level DIVs. In most cases, however, this won’t work. In my case I had both background-image and background-color set, and both were needed. That said however, if none of the other workarounds would have worked for me, I would have experimented with wrapping an extra DIV around the content — one with no background. I have no idea if this will work or not, but regardless, it’s another unnecessary element on your page and comes dangerously close to Divitus. But if it’s the only way to get the job done and force your content to reappear and stay, it may just be a necessary element after all.
If none of these workarounds work for you, then unfortunately, as is frequently the case with IE6, you may have to rethink your layout a bit in order to get around this. Aside from that, all we can do is hope and pray that the remaining 20% or so of people will either upgrade to IE7, or ideally anything else.
If you happen to know of another workaround, or have anything else to say about this, fire away in the comments!











October 29th, 2009 at 8:23 am
This quite well-known bug but I always forget the solution:) So thank you.
The worst thing about IE is that there are actually three versions of IE (6, 7, 8) and each of them is different and has different bugs. Therefore optimalization of web for IE means in fact optimalization for three totaly different browsers. I love Firefox because of its automatical updates. On my web 99% visitors have >3 version of Firefox. And IE? 50% 8, 35% 7 and 15% 6. And 15% is still quite a lot. I can’t ignore them.
But as the web, I am currently working on, is for my school and I am not paid for it, I can afford a little bit non-professional approach :) I am going to put big red box to the middle of page. This box will contain some kind of warning (and maybe the F* word, haven’t decided yet) and of course only IE6-users will see it.
October 31st, 2009 at 2:04 pm
Thanks for your response. Indeed, IE and its many versions are the bane of web designers the world over. And with every new release, instead of simply adopting the standards that everyone else has been using and that worked perfectly well for the last decade, they decide to go off and create their own new “standard”. FAIL.