0

I am trying to make the css of input type number just like in the Google Chrome. but it is not working in my mozila browser.

image

I don't know how to make it just like it is seen in Google chrome.

input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    cursor:pointer;
    display:block;
    width:8px;
    color: #333;
    text-align:center;
    position:relative;
  }

  input[type=number]::-webkit-inner-spin-button:before,
  input[type=number]::-webkit-inner-spin-button:after {
    content: "^";
    position:absolute;
    right: 0;
    font-family:monospace;
    line-height:1px;
  }

  input[type=number]::-webkit-inner-spin-button:before {
    top:0px;
  }

  input[type=number]::-webkit-inner-spin-button:after {
    bottom:0px;
    -webkit-transform: rotate(180deg);
  }
<input type="number" value="10" max="15">

1 Answers1

1

That's because you can't use pseudo classes on the ::webkit-inner-spin-button.

See this for a working example

This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future. source

enter image description here

Community
  • 1
  • 1
Kevin Jantzer
  • 9,215
  • 2
  • 28
  • 52