输入类型=“数字”在Firefox中运行错误

时间:2018-05-22 16:59:04

标签: html css forms firefox numbers

我在html中使用输入类型=“数字”,它在Chrome(v66)中看起来很棒,但在Firefox(v60)中没有。结果如下:

使用谷歌浏览器:

Google Chrome

使用Mozilla Firefox:

Mozilla Firefox

我怎么能用Firefox修复它?

谢谢!

1 个答案:

答案 0 :(得分:3)

Chrome和Firefox在用户表单(以及其他一些内容)上预先构建了视觉变体。

避免这种情况发生的最佳方法是使用css简单地设计自己的统一外观。例如:

input[type="number"] {
   // whatever style you want, i'll go with basic box as an example
   border: 1px solid black;
   width: 50px;
   height: 30px;
}
相关问题