Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable the resize grabber of <textarea>? [duplicate]

Tags:

html

css

forms

How to disable the grabber in the <textarea>?

I mean that triangle thing which appears in the right-bottom corner of the <textarea>.

like image 377
Jack Billy Avatar asked Mar 11 '11 10:03

Jack Billy


People also ask

How do I restrict textarea size?

You can set the size of a text area using the cols and rows attributes. To limit the number of characters entered in a textarea, use the maxlength attribute. The value if the attribute is in number. Specifies that on page load the text area should automatically get focus.

Can you disable a textarea?

In order to disable a textarea (or any other input element), you can: In HTML, you can write: <textarea id='mytextarea' disabled></textarea> From jQuery, you can: $("#mytextarea"). attr("disabled","disabled");

Can I style the resize grabber of textarea?

This displays as follows in Chrome 26 on OS X: Note: Adding display: none to ::-webkit-resizer doesn't actually prevent the user from resizing the textarea, it just hides the control. If you want to disable resizing, set the resize CSS property to none .


2 Answers

Just use resize: none

textarea {    resize: none; } 

You can also decide to resize your textareas only horizontal or vertical, this way:

textarea { resize: vertical; }

textarea { resize: horizontal; }

Finally, resize: both enables the resize grabber.

like image 89
anothershrubery Avatar answered Oct 17 '22 06:10

anothershrubery


<textarea style="resize:none" name="name" cols="num" rows="num"></textarea> 

Just an example

like image 45
Tom Avatar answered Oct 17 '22 06:10

Tom