【问题标题】:How to resize input field如何调整输入字段的大小
【发布时间】:2013-04-24 15:01:52
【问题描述】:

我正在尝试调整输入字段的大小,但我找到的代码不再起作用。

#mededeling 
{
resize: both;
}

有人知道最新的工作代码吗?

【问题讨论】:

标签: css input resize field


【解决方案1】:

使用 textarea 代替 input 怎么样? 1row height textarea看起来就像输入类型[text],可以提交表单:

textarea name="" id="" cols="30" rows="1"

【讨论】:

    【解决方案2】:
    <style>
        input {
            resize: horizontal;
            width: 200px;
        }
    
        input:active {
            width: auto;   
        }
    
        input:focus {
            min-width: 200px;
        }
    </style>  
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-01-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-06-08
      • 2015-09-21
      相关资源
      最近更新 更多