如何隐藏数字输入框的上下箭头?

方案一:

在Chrome下:css

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none !important;
  margin: 0; 
}

Firefox下:html

input[type="number"] {
  -moz-appearance: textfield;
}

方案二:

type="number"改成type="tel", 一样是数字键盘, 可是没有箭头.html5

参考:

Stack Overflow: Can I hide the HTML5 number input’s spin box?
移除HTML5 input在type="number"时的上下小箭头web

相关文章
相关标签/搜索