Web development, coding & SEO


ie6-character-leak, and space below

Is IE6 a bad guy or a good guy, is it time for IE6 to die or not (don't be racist!), 20% of Internet users are still using IE6 today, in the middle of year 2009.

  1. One phenomena related to IE6 is a character leak.
  2. Second mystery is a double space below.

Definitely, there is set of fixed rules and math that handle everything.

Some magic advices googled from the Internet. Sometimes these avices help, sometimes not.

Some observations.

A case study. Doc type is XHTML 1.0 Transitional here.

We have got 3 divisions:

  1. inner element, has some text inside,
  2. between div, surrounds the inner one,
  3. outer div, surrounds the between one.

If distance between the Inner and the Between is less than 3px, IE6 adds some space below the inner element. That occurs usually when the Inner has a declared width that gets closer than 3 px.

If distance between the Between and the Outer is less than 3 px, the Inner doubles last characters and leaks them outside itself.

Distance between the Between and the Outer becomes less than 3 px if:

  1. width of the Between is declared to be so,
  2. the Between is pushed by the Inner (Inner is expanded by some content inside).

The more inner-div like divs preceed to it, the more bespoke one leaks.

Placed just a not-styled div around the inner-div - leakage stopped.

Case A.

If something touches div's right wall from inside, the div leaks some characters placing them below himself.

Floatedness doesn't play any role here.

Leave at least 3px distance. Make the inner div 3px narrower.

This construction doesn't work:

This construction works:

Case B.

Most often the leak happens when the outmost div of the html page is touched by any of the inner divs.

Case C.

In combination with several other conditions, anything that touches the right wall, can cause any other same level div, that's located above, to leak.

Conclusion

For IE6 - leave at least 3 px space right of every division,

Frequently, all 100% widhts will cause IE6 character leak or double space.

Frequently, mixed 100% and fixed -3px widths are OK.

Almost aways, all -3px fix widths are bulletproof.

Another case

Sometimes an element X somewhere many floors above triggers the leak from an element on the bottom. All those 3px spaces doesn't help.

Placing <div><!-- --></div> right after the element X stops the leak below.

More folklore from WWW

2009.