How to disable the textarea element from resizing
In this tutorial, we are going to learn about how to disable the html textarea element from resizing.
By default textarea
element is enabled for resizing so that we can resize it by dragging the mouse on the bottom right corner.
To disable resizing we need to add a css resize
property with value none
.
Here is an example:
textarea {
resize:none;
}
If you want to disable for a particular textarea element first, you need to select that element
using id
or class
attribute then add a resize
property.
<textarea id="feedback" rows="5" cols="33"></textarea>
#feedback{
resize:none;
}