internet explorer 7 - Is there an alternative to the CSS white-space property for use in IE 7? -


i'm trying display text line breaks in div using css white-space property value of pre-line. works expected chrome, firefox, , ie 8, not in ie 7.

for example,

<div style="white-space:pre-line"> css has pretty useful property called white-space i’m guessing goes unnoticed among css beginners.  can live without property quite time, once learn how use it, come in handy , you’ll find going on , on again. </div> 

will display in chrome, firefox, , ie 8 this:

css has pretty useful property called white-space i’m guessing goes unnoticed among css beginners.

you can live without property quite time, once learn how use it, come in handy , you’ll find going on , on again.

but in ie 7 displays this:

css has pretty useful property called white-space i’m guessing goes unnoticed among css beginners. can live without property quite time, once learn how use it, come in handy , you’ll find going on , on again.

you can see here: http://jsfiddle.net/vsqnp/10/.

i've tried values of pre, text doesn't wrap , long lines run off right side of div, , pre-wrap, has same problem in ie 7.

ie7 doesn't support white space handling property pre-line. see page compatibility table.

you can use these declarations instead

white-space: pre; word-wrap: break-word; 

it's not alternative pre-line, it's breaking words not lines @ least content not exceed boundaries of container.


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

android - layout with fragment and framelayout replaced by another fragment and framelayout -