How to remove arrows/spinners from input type number with CSS?

CSSWeb DevelopmentFront End Technology

Following is the code to remove arrows/spinners from input type using CSS −

Example

 Live Demo

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style>
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
   -webkit-appearance: none;
   margin: 0;
}
input[type="number"] {
   -moz-appearance: textfield;
}
</style>
</head>
<body>
<h1>Input Numbers Hide Arrows</h1>
<input type="number" value="10">
<h2>Only numbers can be entered in the above field</h2>
</body>
</html>

Output

his will produce the following output −

raja
Published on 08-Apr-2020 11:01:17
Advertisements