Duplicate content bug: text appears twice in IE7 and IE9

The double or duplicate content error is very hard to re-create and to debug. The symptom is that some content (usually text) appears twice on your screen, the second one usually in a margin. The two copies are, in fact, the same: selecting part of either copy will result in a highlight at both(!) places. Quite weird.

This error usually affects IE7 and IE8 in compatibility mode. I have found two things that can cause this:
  • A floated container with block-level content only. Try to put some small inline content into all containers around the affected area. Having no inline content can also cause vertical misalignment in the same browsers.
  • Two HTML comments following each other immediately. This can be tricky to spot, especially if you're using SSI includes.

Popular Posts