Turn off textarea resizing

前端 未结 8 1559
暗喜
暗喜 2021-01-30 03:51

I\'m trying to turn off textarea resizing in my site; right now I\'m using this method:

.textarea {
    clear:left;
    min-width: 267px;
    max-width: 267px;
          


        
8条回答
  •  终归单人心
    2021-01-30 04:25

    Just one extra option, if you want to revert the default behaviour for all textareas in the application, you could add the following to your CSS:

    textarea:not([resize="true"]) {
      resize: none !important;
    }
    

    And do the following to enable where you want resizing:

    
    

    Have in mind this solution might not work in all browsers you may want to support. You can check the list of support for resize here: http://caniuse.com/#feat=css-resize

提交回复
热议问题