Word-Wrap in Rich Text Area

2.3k Views Asked by At

I m trying to design a text editor in my website for which i m using rich text editor/rich text area. But while using rich text editor/rich text area i m unable to wrap the words. if a user is trying to write a statement without any space then the statement do not wrap to next line in place of that an horizontal scroll bar is generated in the rich text editor/rich text area..

Can any help me to wrap the content of the rich text editor/rich text area.

thank you in advance

2

There are 2 best solutions below

2
On

Did you try the CSS approach? In the end the text area is a generated HTML and it should work. Use word-wrap to break it into lines.

.break-word {word-wrap: break-word;}
0
On

Try this

.breakword
{
     white-space: pre-wrap; /* css-3 */
     white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
     white-space: -pre-wrap; /* Opera 4-6 */
     white-space: -o-pre-wrap; /* Opera 7 */
     word-wrap: break-word; /* Internet Explorer 5.5+ */
}

Reference : http://www.2lessons.info/2012/09/how-to-use-prettify-with-bloggerblogspot.html