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
  • 23,465
  • 48
  • 152
  • 268

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
  • 65,599
  • 28
  • 144
  • 152
1

Set rows and cols property to it

user229044
  • 232,980
  • 40
  • 330
  • 338
Vishal Pawar
  • 4,324
  • 4
  • 28
  • 54
0

Just need to add:

textarea
{
    word-break:break-all;
}
Naor
  • 23,465
  • 48
  • 152
  • 268