Firefox wraps text inside spans and divs neatly without expanding them. I'm having trouble achievin开发者_StackOverflow中文版g 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) ?
Try the word-wrap property:
word-wrap: break-word;
-ms-word-wrap: break-word;
IE requires a special property.
If JQuery is an option for you try the jQuery word wrap plugin
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.
加载中,请稍侯......
精彩评论