Sometimes, we want to restrict max text area width and height.
How to restrict max text area width and height,we wi’ll look at in this article.
How can we restrict max text area width and height?
To restrict max text area width and height, we can also 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 have to 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 also set the resize
, max-height
and max-width
CSS properties.