html textarea 怎样才能不显示滚动条

如题所述

你是想要不显示滚动条,随内容往下拉伸?

单纯的textarea不能做到 ,  你可以用div模拟一样个类似的 textarea效果:

     html:  <div class="test" contenteditable="true">  
          
            </div> 
     css :     
         .test {
            width: 400px;
            min-height: 20px;
            max-height: 1000px;//超过1000px出现滚动条
            margin: auto;
            padding: 13px;
            outline: 0;
            border: 1px solid #a0b3d6
            font-size: 16px;
            line-height: 24px;
            word-wrap: break-word;
            overflow-x: hidden;
            overflow-y: auto;
          
         }

温馨提示:内容为网友见解,仅供参考
无其他回答
相似回答
大家正在搜