0

I am looking at MDN for spinners (arrows for input type="number") and it says it is non standard. The way I remember is MDN also tell you what to use but in this case, it isn't. My problem is that while I am using

input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  -moz-appearance: textfield;
  margin: 0;
}

It works for chrome but not for firefox. So I am guessing due to non-standard it is not applying, What is the "Standard" Workaround for it?

localhost
  • 822
  • 2
  • 20
  • 51

1 Answers1

1

input[type=number]::-webkit-inner-spin-button this will work as a selector when browser is webkit otherwise none of styles within this selector will be applied.

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

input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
}
<input type="number">
Abhishek Pandey
  • 13,302
  • 8
  • 38
  • 68