Sometimes, we want to disable text area resizing with CSS.
In this article, we’ll look at how to disable text area resizing with CSS.
How to disable text area resizing with CSS?
To disable text area resizing with CSS, we set the resize
property.
For instance, we write
textarea {
resize: none;
}
to disable resizing completely.
Or we write
textarea {
resize: vertical;
}
to disable resizing vertically.
Or we write
textarea {
resize: horizontal;
}
to disable resizing verticallyhorizontally.
Or we write
textarea {
resize: horizontal;
max-width: 400px;
min-width: 200px;
}
to enable horizontal resizing but up to a max dimension.
Conclusion
To disable text area resizing with CSS, we set the resize
property.