Getting Rid Of <PRE>
The problem is that the alternative to <PRE> is the white-space style. I have tried to implement this here but I ran across
XML Declaration Problems in that the
XML Declaration causes IE6 to go into quirks mode which stops the style from working.
I have now done some fiddling with this and it seems there isn't an ideal solution. I detect the browser (and platform, etc.) anyway so one option was to leave the
XML Declaration out for Internet Explorer - this caused the style to start working but, as I should have guessed, it stops wrapping which makes things messy. It also caused other styles (like the one which kills the scrollbars on the page) to fail and I that was definetly a no no. The compromise was to just run the
PHP nl2br() function over it (through the
Callback function) which adds in the <BR /> which makes everything work nicely on all browsers.
This clearly can only work when you are processing the input and I would like a CSS-only solution to this. I'll keep fiddling.
See also:
CSS white-space
Wicklinks
Semantically Correct (in: 25 | out: 0)
PHP (in: 9 | out: 1)
XML Declaration Problems (in: 3 | out: 3)
Wick (in: 3 | out: 1)
XML Declaration (in: 2 | out: 1)
U Ranker Rankings
We are automatically monitoring the Google rankings that people use to visit this page.
"emperor makes declaration" Ranked: 1 (visits: 5)
"alternative to pre" css Ranked: 1 (visits: 2)
alternative to in css
Ranked: 1 (visits: 1)
why emperor makes declaration Ranked: 1 (visits: 1)
white-space-style pre Ranked: 2 (visits: 1)
More >>