自定义CSS允许chrome textarea调整大小小于初始状态? [英] Custom CSS to allow chrome textarea resize smaller than initial state?

查看:249
本文介绍了自定义CSS允许chrome textarea调整大小小于初始状态?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我喜欢Chrome的漂亮textarea调整大小控制。但是,一个例外是textarea看起来有一个硬的最小高度/最小宽度设置,即使使用!important 限定符,也不能通过自定义css更改。

  textarea#myTextArea {min-height:0!important; min-width:0!important} 
解决方案

是否可以通过jQuery覆盖这个?这些 min-height / min-width 依赖 cols rows 属性。
例如如果 cols 缺失或小于1,则其默认值为20,因此最小宽度将为20个字符宽度。



(cf。 http://www.w3.org /TR/html5/forms.html#the-textarea-element



您无法调整 textarea 在其初始维度下报告为错误( https:/ /code.google.com/p/chromium/issues/detail?id=94583 )虽然


用户代理可能




p> http://www.w3.org/TR/css3-ui/#resize



不幸的是,现在没有办法改变这种行为。


I like Chrome's nifty textarea resize control. However, the one exception is that the textarea appears to have a hard min-height/min-width setting that's not changeable via custom css, even with !important qualifiers.

textarea#myTextArea{min-height:0 !important;min-width:0 !important}

Is it possible to override this via jQuery perhaps?

解决方案

These "min-height/min-width" rely on cols and rows attributes. Eg. if cols is missing or less than 1, its default value is 20, so the minimum width will be 20 characters width.

(cf. http://www.w3.org/TR/html5/forms.html#the-textarea-element)

The fact you cannot resize a textarea under its initial dimensions is reported as a bug (https://code.google.com/p/chromium/issues/detail?id=94583) although

The user agent may restrict the resizing range to something suitable, such as between the original formatted size of the element, and large enough to encompass all the element's contents.

http://www.w3.org/TR/css3-ui/#resize

Unfortunately it seems there's no way for now to change this behaviour.

这篇关于自定义CSS允许chrome textarea调整大小小于初始状态?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆