Enable vertical scrolling on textarea

前端 未结 5 1848
盖世英雄少女心
盖世英雄少女心 2020-12-14 15:29

I have a textarea that I want to enable vertical scrolling. When I exceed the height of the textarea, it increases in size. The scroll bar does not appear. I want that a ver

相关标签:
5条回答
  • 2020-12-14 15:50

    Try this: http://jsfiddle.net/8fv6e/8/

    It is another version of the answers.

    HTML:

    <label for="aboutDescription" id="aboutHeading">About</label>
    <textarea rows="15" cols="50" id="aboutDescription"
        style="max-height:100px;min-height:100px; resize: none"></textarea>
    <a  id="imageURLId" target="_blank">Go to
        HomePage</a>
    

    CSS:

    #imageURLId{
    font-size: 14px;
    font-weight: normal;
    resize: none;
    overflow-y: scroll;
    
    }
    
    0 讨论(0)
  • 2020-12-14 15:54

    Simply, change

    <textarea rows="15" cols="50" id="aboutDescription"
    style="resize: none;"></textarea>
    

    to

    <textarea rows="15" cols="50" id="aboutDescription"
    style="resize: none;" data-role="none"></textarea>
    

    ie, add:

    data-role="none"
    
    0 讨论(0)
  • 2020-12-14 16:04

    Maybe a fixed height and overflow-y: scroll;

    0 讨论(0)
  • 2020-12-14 16:06

    You can try adding:

    #aboutDescription
    {
        height: 100px;
        max-height: 100px;  
    }
    
    0 讨论(0)
  • 2020-12-14 16:12

    Here's your CSS

    element{
      width: 200px;
      height: 300px;
      overflow-y: auto;
    }
    
    0 讨论(0)
提交回复
热议问题