Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the -webkit-appearance for input type="number"?

Tags:

css

I have an input like this:

<input type="number">

And my CSS has this:

-webkit-appearance:none;

So when I view it on webkit, the rocker (up and down) isn't showing.

I want to override this, what is the default webkit-appearance value for type="number"?

There are a ton of values listed here. Here is jsFiddle for testing.

like image 777
Henrik Petterson Avatar asked Oct 31 '25 12:10

Henrik Petterson


1 Answers

When wanting things to return to default, initial is almost always the go-to value:

input[type=number] {
  -webkit-appearance: initial;
}

The initial CSS keyword applies the initial value of a property to an element. It is allowed on every CSS property and causes the element for which it is specified to use the initial value of the property.

– initial - MDN

JSFiddle.

like image 155
James Donnelly Avatar answered Nov 03 '25 04:11

James Donnelly



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!