How do I disable the resizable property of a textarea?

后端 未结 18 1158
北荒
北荒 2020-11-22 09:56

I want to disable the resizable property of a textarea.

Currently, I can resize a textarea by clicking on the bottom right corner of the

18条回答
  •  感情败类
    2020-11-22 10:52

    You simply use: resize: none; in your CSS.

    The resize property specifies whether or not an element is resizable by the user.

    Note: The resize property applies to elements whose computed overflow value is something other than "visible".

    Also resize not supported in Internet Explorer at the moment.

    Here are different properties for resize:

    No Resize:

    textarea {
      resize: none;
    }
    

    Resize both ways (vertically & horizontally):

    textarea {
      resize: both;
    }
    

    Resize vertically:

    textarea {
      resize: vertical;
    }
    

    Resize horizontally:

    textarea {
      resize: horizontal;
    }
    

    Also if you have width and height in your CSS or HTML, it will prevent your textarea be resized, with a broader browsers support.

提交回复
热议问题