Jump to content

White-space:pre-wrap Ie8 Problem


tal
 Share

Recommended Posts

Helloi have a lot of text with line breaks and white spaces that i want to keep when presentingmy code looks like this<!DOCTYPE html PUBLIC "-//W3C//DTD html 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">...<div style="white-space:pre-wrap;width:340px;height:113px;overflow:auto;">A LOT OF TEXT WITH LINE BREAKS AND MULTI-WHITE-SPACES</div>in FF 3.5.3 it works fine with "white-space:pre" or "white-space:pre-wrap"and i see all the line breaks and multi-white-spacesbut with IE8 at best i get the line to break when it reaches the border of my div box width:340px;it ignores the line breaks and the multi-white-spaces i wrotewhat am i to do in order to see the text as i wrote it (with line breaks and multi-white-spaces) in IE8 ?Thanks for any helpTal

Link to comment
Share on other sites

open this in FF and IE8 to see the porblem replace the ------------ with spaces as this form cuts them out<div style="white-space:pre-wrap;">first line of wordsnext line-------------------and some more after many spaces</div>thank youTal

Edited by tal
Link to comment
Share on other sites

that's funny, i see it in FF3 and IE8 and in both cases the space are preserved. IE7 is a different story though...I'm using a XHTML strict DTD but I don't think that would matter.edit: I guess it does. Well, if you use an XHTML strict DTD it will work in FF3 and IE8 at least. 2/3 aint bad, haha.I wonder if trying a span set to display:block and assigned a width? What are you trying to display, just text?edit: span didn't work.

Edited by thescientist
Link to comment
Share on other sites

i checked with the XHTML doc-type but it didn't change it i think it is not in the cssuntil now i have checked my css code in a php file now i have checked it in a html file and as you said it works in both FF3 and IE8(i dont have IE7, but i will need to find out a solution for that as well)now i will need to find out what in the php parsing does that and it is a text only chat, that i am makingthank you for your help i wouldn't think about it otherwise Tal

Edited by tal
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...