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?
Asked
Active
Viewed 605 times
1

Naor
- 23,465
- 48
- 152
- 268
3 Answers
4
Use word-wrap: break-word; to wrap the long unbroken line.
textarea
{
word-wrap: break-word;
}

Kyle
- 65,599
- 28
- 144
- 152
-
I don't want to hide the text - I just want to prevent the textarea from expanding. – Naor Dec 01 '11 at 07:26
-
You want to prevent it from expending, or to limit the input size? – Michael Sazonov Dec 01 '11 at 07:30
-
@Naor overflow hidden hide the scrollbar even though you can see the expanded text. – Punit Dec 01 '11 at 07:31
-
@Michael Sazonov: prevent it from expending. – Naor Dec 01 '11 at 07:45
-
@punit: putting long text without spaces expand the textarea width and this is what I want to prevent. – Naor Dec 01 '11 at 07:45