Link to home
Start Free TrialLog in
Avatar of MrEvans
MrEvans

asked on

white-space: pre-wrap in IE7

I'm trying to find an alternative to the CSS "white-space: pre-wrap".

This does exactly what I need it to do in all browsers but IE7 - I want the text to be wrapped but i want the spaces preserved and not collapsed.

The CSS code below was found on many sites but it doesn't do what I want it to in IE.

IE will wrap the text, but collapses it too.

Any help is much appreciated.
white-space: pre; /* CSS2 */ 
       white-space: -moz-pre-wrap; /* Mozilla */ 
	white-space: -hp-pre-wrap; /* HP printers */ 
	white-space: -o-pre-wrap; /* Opera 7 */ 
	white-space: -pre-wrap; /* Opera 4-6 */ 
	white-space: pre-wrap; /* CSS 2.1 */ 
	white-space: pre-line; /* CSS 3 (and 2.1 as well, actually) */ 
	word-wrap: break-word; /* IE */ 
	_white-space: pre; /* IE hack to re-specify in addition to word-wrap */

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of David S.
David S.
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial