Home >Web Front-end >CSS Tutorial >How Can I Remove Number Input Spinner Buttons in WebKit Browsers?
Suppressing Input Type "Number" Spinner Buttons in Webkit
When designing a website for both mobile (Mobile Safari) and desktop users (Chrome, Safari), consider the visual aesthetics of input fields designated for numerical entries using the tag. On mobile, this tag optimally facilitates numeric input via a numerical keypad. However, in Chrome and Safari, unwanted spin buttons appear beside these fields, potentially clashing with design aesthetics.
Disabling Spinner Buttons Using CSS
To eliminate these buttons using CSS, leverage the following code:
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
This code effectively hides the inner and outer spin buttons, ensuring a clean and sleek design for numerical input fields. Additionally, remember to set the margin on these elements to zero to prevent unwanted spacing around the input field.
The above is the detailed content of How Can I Remove Number Input Spinner Buttons in WebKit Browsers?. For more information, please follow other related articles on the PHP Chinese website!