1

I am using IE8 and I have textarea on the page. It's width set to 80% with maxlength of 132 chars.
If the user write text that not contains spaces, like the letter V 132 times without spaces, the textarea grows horizontaly (width grows).
How can I prevent this behaviour - I don't want allow the width to grow?

Naor
  • 22,523
  • 46
  • 144
  • 260

3 Answers3

4

Use word-wrap: break-word; to wrap the long unbroken line.

textarea
{
    word-wrap: break-word;
}

http://jsfiddle.net/bLKPq/2/

Kyle
  • 63,222
  • 27
  • 141
  • 151
1

Set rows and cols property to it

user229044
  • 222,134
  • 40
  • 319
  • 330
Vishal Pawar
  • 4,181
  • 3
  • 27
  • 54
0

Just need to add:

textarea
{
    word-break:break-all;
}
Naor
  • 22,523
  • 46
  • 144
  • 260