How to restrict max textarea width and height in chrome or how to disable textarea resizing

白昼怎懂夜的黑 提交于 2019-12-05 11:05:01

问题


Chrome allowed to resize text area by drugging that on the bottom right corner, but some times this movement may break design of the page, so i am wondering how to restrict the max and min width for that action of how to disable that function at all with thml/javascript/css on the page?


回答1:


You can disable re-sizing it with the following css:

resize: none;



回答2:


You can also restrict to horizontal resizing only with:

resize: horizontal;

and only vertical resizing with:

resize: vertical; 



回答3:


This is all a matter of CSS. To disable the resizing (drag thumb) just use resize: none;. To restrict size max(min)-width and height should do the trick.




回答4:


you can use :

resize: vertical; 
max-height: 200px;



回答5:


you can use

resize:none

to restrict the resizing of a textarea.



来源:https://stackoverflow.com/questions/7204584/how-to-restrict-max-textarea-width-and-height-in-chrome-or-how-to-disable-textar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!