I have a multiline input on my html form and some browsers (firefox 4 and chrome) allow users to resize it dynamically. It is nice, but it breaks my layout. Is it possible to disable this feature?
Thanks
The <textarea> tag defines a multi-line text input control. The <textarea> element is often used in a form, to collect user inputs like comments or reviews. A text area can hold an unlimited number of characters, and the text renders in a fixed-width font (usually Courier).
To create a multi-line text input, use the HTML <textarea> tag. You can set the size of a text area using the cols and rows attributes. It is used within a form, to allow users to input text over multiple rows.
If users resize the field, it's probably because they want (or need) it to be bigger 1.
In such a case, you should consider your users know what they are doing, are doing it because they want / need to, and that they will accept the layout to be a little broken, provided it allows them to use that textarea.
Still, if you want to do that (you shouldn't), quoting How do I disable textarea resizing? :
textarea {
resize: none;
}
1. I don't see very well, and when I zoom, or make something bigger, it's because I need too -- and, in such a case, I prefer a layout a bit broken to a website I cannot use !
Use CSS:
textarea {
resize: none;
}
See resize
property @ MDC.
A better solution, however, is to fix your layout so that resizing the textarea doesn't break the layout (at least for reasonable amounts of resizing). Depending on just how, and how badly, it breaks the layout, users might not event mind it. The typical web user will probably never even notice the little resize handle anyway.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With