• Post category:JavaScript
  • Reading time:2 mins read

In this short article, we will show you how to disable the resizing of the textarea element. Usually, when we add a textarea element to a page, we can resize the textarea by dragging the icon in the lower right corner. So we will disable that property using CSS.

CSS rule to disables resizing behavior of the textarea

We can use the resize property to disable the resizing behavior of the textarea element.

textarea {
  resize: none;

List of the other options available for resize property.

  • none – To disable the resizing of the textarea.
  • both – Resize the element’s height and/or width.
  • horizontal – The user can resize the element horizontally.
  • vertical – Resize the element vertically.
  • inherit – The element inherits the resize value of its parent.

That’s it for today.
Thank you for reading. Happy Coding..!!

Leave a Reply