Turn off textarea resizing

前端 未结 8 1533
暗喜
暗喜 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
    //CSS:
    .textarea {
        resize: none;
        min-width: //-> Integer number of pixels
        min-height: //-> Integer number of pixels
        max-width: //-> min-width
        max-height: //-> min-height
    }
    

    above code works on most browsers

    //HTML:
    <textarea id='textarea' draggable='false'></textarea>
    

    do both for it to work on the maximum number of browsers

    0 讨论(0)
  • 2021-01-30 04:27

    As per the question, i have listed the answers in javascript

    By Selecting TagName

    document.getElementsByTagName('textarea')[0].style.resize = "none";
    

    By Selecting Id

    document.getElementById('textArea').style.resize = "none";
    
    0 讨论(0)
提交回复
热议问题