CSS - IE6 and white-space: pre

This is nore really a full Uniface related post. But as I found this to be as bad as can be, I wanted to share this with you.

CSS has various ways to shape the output. One method is the white-space command. It will take a text and render it in the way it is shaped (e.g. " " => one space, "%%^" or "\n" => LineBreak).

The problem with this simply the IE6! It takes this command only in the STANDARD mode. But on some reasons it switches back to quirks mode and ignores you white-space command.

Using google to find a solution is not a big deal. After having read a dozen of descriptions dealing with this, you will know that if you put something in front of the <!DOCTYPE ...> description line, IE6 will fall back to quirks mode. Well, we can of course avoid this and get the desired layout.

AJAX does it too

As you could choose to load content dynamic and have a layouted text within that, things get more difficult. A little piece of content doesnt have a <!DOCTYPE ...> description and so the IE6 falls back to quirks mode immediately! As a matter of fact, there is nothing to be done there to fix this which leaves (not only) a customer unsatisfied.

The Cure for IE6

To let the your text remain in the desired shape, you will have to force IE6 to do this! Not with CSS but with the good old html tag <pre> ... </pre>. Just wrap it around the text and after that, IE6 will obey to your desire.