/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] white-space: pre; and Internet Explorer

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 [url=http://msdn.microsoft.com/en-us/library/ms531182(VS.85).aspx]this page[/url]), on the other hand, only preserves white space. According to [url=http://www.w3.org/TR/CSS2/text.html#white-space-prop]standards[/url], Firefox is right. Is there any way I can make this work on Internet Explorer, too? Thanks ?

to post a comment
CSS

5 Comments(s)

Copy linkTweet thisAlerts:
@ZnupiauthorMay 05.2009 — Anyone knows? Maybe there's some sort of IE-specific trick? :rolleyes:
Copy linkTweet thisAlerts:
@FangMay 05.2009 — Do you have an example where it doesn't work?
Copy linkTweet thisAlerts:
@ZnupiauthorMay 05.2009 — http://it-ride.blogspot.com/ -- look at the code containers.
Copy linkTweet thisAlerts:
@FangMay 05.2009 — #main-wrapper code.syntax {word-wrap:normal;}
#main-wrapper cascade apparently causes the line breaking
Copy linkTweet thisAlerts:
@ZnupiauthorMay 05.2009 — Ah, thanks, that seems to have done it!
×

Success!

Help @Znupi spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...