How can I disable the resizable property of a textarea?

If coding is more your thing then the Website Development & Scripting forums are for you. Share server-side scripting and database integration tips, tricks and problems here.
Post Reply
JamesCroni
Newbie
Posts: 1
Joined: Tue Mar 10, 2020 3:01 pm

#1

Hello,

I want to the way to disable the resizable property of a textarea. Currently, I can resize a textarea by clicking on the bottom right corner of the textarea and dragging the mouse.

How can I disable this?


User avatar
edwin
Junior Member
Posts: 31
Joined: Thu Sep 28, 2017 6:17 pm

#2

The following CSS rule disables resizing behaviour for textarea elements:

Code: Select all

textarea {
  resize: none;
}
To disable a specific textarea with the name attribute set to info (i.e., <textarea name="info"></textarea>):

Code: Select all

textarea[name=info] {
  resize: none;
}
Or, using an id attribute (i.e., <textarea id="info"></textarea>):

Code: Select all

#info {
  resize: none;
}
Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 0 guests