tal Posted October 15, 2009 Share Posted October 15, 2009 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 More sharing options...
thescientist Posted October 15, 2009 Share Posted October 15, 2009 maybe put your text in <p> tags? and apply your style to that? Link to comment Share on other sites More sharing options...
tal Posted October 16, 2009 Author Share Posted October 16, 2009 have tried doing it with <p> but no success IE8 still ignores my spaces and line breaks while FF 3.5.3 doesn't ignore them (as should be)thank youTal Link to comment Share on other sites More sharing options...
thescientist Posted October 16, 2009 Share Posted October 16, 2009 link and/or code? Link to comment Share on other sites More sharing options...
tal Posted October 16, 2009 Author Share Posted October 16, 2009 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 Link to comment Share on other sites More sharing options...
thescientist Posted October 17, 2009 Share Posted October 17, 2009 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. Link to comment Share on other sites More sharing options...
tal Posted October 17, 2009 Author Share Posted October 17, 2009 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 Link to comment Share on other sites More sharing options...
thescientist Posted October 17, 2009 Share Posted October 17, 2009 well, if you have IE8 you have IE7, essentially.... Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.