1 | initial version |
Yes, it is possible to conceal the spin box of the HTML5 number input using CSS. Here's how:
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
input[type="number"] {
-moz-appearance: textfield; /* Firefox */
}
This CSS code will hide the spin box in Chrome, Safari, and other WebKit-based browsers. The spin box will still be visible in Firefox, but the -moz-appearance: textfield;
rule will make it look like a regular text input.