views:

35

answers:

3

Firefox wraps text inside spans and divs neatly without expanding them. I'm having trouble achieving this with IE. IE only wraps words at word separators like spaces or hyphens. If the text does not contain spaces or hyphens the span expands in width. How do I get it to wrap arbitrarily and maintain the width of the span (or div) ?

A: 

IE requires a special property.

If JQuery is an option for you try the jQuery word wrap plugin

microspino
+2  A: 

Try the word-wrap property:

word-wrap: break-word;
-ms-word-wrap: break-word;
Andy E
A: 

Try something like this:

<P STYLE="word-wrap: break-word; -ms-word-wrap: break-word; width:100%;left:0">
LongWordLongWord...LongWordLongWord</P>

Taken from -ms-word-wrap Attribute Edited a bit.

Kyle Sevenoaks