【问题标题】:how to prevent chrome from changes the width of the input with min and max values如何防止 chrome 用最小值和最大值改变输入的宽度
【发布时间】:2017-04-21 09:37:22
【问题描述】:

chrome 默认更改输入的宽度以适应 minmax 值, 好像它添加了一个size attr。给它

如何防止 chrome 这样做?

https://jsfiddle.net/cobratst/apj75p7q/

【问题讨论】:

  • 在css中设置宽度?没有其他方法可以在所有浏览器中获得(几乎)统一的表单元素,afaik。

标签: html google-chrome


【解决方案1】:

这里可能有重复的问题:Styling HTML5 input type number

只需使用 CSS 为您的输入设置样式,如上述问题,或应用内联样式:

<input style="width:50%;">

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-08-03
    • 2020-02-28
    • 1970-01-01
    • 1970-01-01
    • 2021-07-10
    • 1970-01-01
    • 1970-01-01
    • 2018-05-28
    相关资源
    最近更新 更多