简体   繁体   English

调整HTML输入元素上的拖动器的大小,就像在textarea元素上一样

[英]Resize dragger on HTML input element just like on textarea element

Is it possible to have a resize dragger on input elements just like there is on textarea elements by default (by resize dragger I mean the little area on the bottom right corner where you can click and hold in order to resize the textarea box)? 是否有可能在输入元素上具有调整大小的拖动器,就像默认情况下在textarea元素上一样(通过调整大小的拖动器,我是指右下角的小区域,您可以单击并按住以调整文本区域框的大小)?

I tried to add 'resize:both;' 我试图添加'resize:both;' to the styles of the input element, with no success (see fiddle here ): 输入元素的样式,但没有成功(请参见此处的小提琴 ):

<input type="text" />

With the CSS: 使用CSS:

input {resize: both;}

I would be looking for an script-less solution, only relying on HTML and / or CSS, ideally crossbrowser. 我会寻找一种无脚本的解决方案,仅依赖HTML和/或CSS,最好是跨浏览器。

resize: both; should work as long as overflow is not set to visible (and the browser supports it!). 只要没有将overflow设置为visible (并且浏览器支持它),它就应该可以工作。

For reference: https://developer.mozilla.org/en-US/docs/Web/CSS/resize 供参考: https : //developer.mozilla.org/en-US/docs/Web/CSS/resize

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM