How do I disable the resizable property of a textarea?

Explanation

To disable the resizable property you have to use the following CSS rule which will resize the behavior for text area elements as shown below :

textarea {
  resize: none;
}

To disable it for some textareas, there are a couple of options such as:

In the tag you can use the attribute class (<textarea class="textarea1">):

.textarea1 {
  resize: none;
}

Or you can disable a specific textarea with the name attribute set to foo (i.e., <textarea name="foo"></textarea>):

textarea[name=foo] {
  resize: none;
}

Or, else you can use an attribute id  (i.e., <textarea id="foo"></textarea>):

#foo {
  resize: none;
}
textarea {
  resize: vertical; /* user can resize vertically, but width is fixed */
}

 

 

Also read, What is the difference between call and apply?

Share this post

Leave a Reply

Your email address will not be published. Required fields are marked *