Click to See Complete Forum and Search --> : [RESOLVED] white-space: pre; and Internet Explorer


Znupi
05-04-2009, 09:27 AM
I have a <code> element with display: block, and I need it to both preserve white space (pre) and not wrap (nowrap). Now, if I specify white-space: pre, Firefox 3 does both, which is excellent. Internet Explorer (7, but I bet 8, too, judging from this page (http://msdn.microsoft.com/en-us/library/ms531182(VS.85).aspx)), on the other hand, only preserves white space. According to standards (http://www.w3.org/TR/CSS2/text.html#white-space-prop), Firefox is right. Is there any way I can make this work on Internet Explorer, too? Thanks :)

Znupi
05-05-2009, 05:35 AM
Anyone knows? Maybe there's some sort of IE-specific trick? :rolleyes:

Fang
05-05-2009, 06:12 AM
Do you have an example where it doesn't work?

Znupi
05-05-2009, 08:46 AM
http://it-ride.blogspot.com/ -- look at the code containers.

Fang
05-05-2009, 09:53 AM
#main-wrapper code.syntax {word-wrap:normal;}
#main-wrapper cascade apparently causes the line breaking

Znupi
05-05-2009, 01:30 PM
Ah, thanks, that seems to have done it!