Input Field, wrap text instead of extending horizontally

Xtian picture Xtian · Jul 15, 2010 · Viewed 59.1k times · Source

I have an input field, a user will write text inside but when the text is to long it just extends horizontally instead of dropping down vertically.

I tried:

overflow: hidden;
word-wrap: break-word;

and I had no luck. Any other suggestions on how to accomplish this?

Answer

Leniel Maccaferri picture Leniel Maccaferri · Jul 15, 2010

I think you should use a multiline input field as TextArea:

http://htmlhelp.com/reference/html40/forms/textarea.html

Sample code:

<textarea rows="10" cols="30"></textarea>