Sometimes, we want to restrict max text area width and height.
In this article, we’ll look at how to restrict max text area width and height.
How to restrict max text area width and height?
To restrict max text area width and height, we can set the resize
, max-height
and max-width
CSS properties.
For instance, we write:
<textarea style='resize: vertical; max-width: 200px; max-height: 200px;'></textarea>
to add a textarea element.
We set the resize
CSS property to vertical
to allow vertical resizing only.
And we set the max-width
and max-height
properties to restrict the size of the textarea.
Conclusion
To restrict max text area width and height, we can set the resize
, max-height
and max-width
CSS properties.