html number input field always display spinner?

后端 未结 3 2064
灰色年华
灰色年华 2021-01-20 00:11

when I make a number input field like this:


Then the number field gets a spinner added to it whenever I hov

3条回答
  •  灰色年华
    2021-01-20 00:55

    It's the Chrome opacity settings that are giving you a headache. This will solve your issue:

    input[type=number]:hover::-webkit-inner-spin-button, 
    input[type=number]:hover::-webkit-outer-spin-button {
       opacity: 1;
    }
    

    This being the problem is kind of opaque.

提交回复
热议问题