Can I hide the HTML5 number input’s spin box?

后端 未结 17 1632
感动是毒
感动是毒 2020-11-22 05:08

Is there a consistent way across browsers to hide the new spin boxes that some browsers (such as Chrome) render for HTML input of type number? I am looking for a CSS or Jav

17条回答
  •  说谎
    说谎 (楼主)
    2020-11-22 05:44

    On Firefox for Ubuntu, just using

        input[type='number'] {
        -moz-appearance:textfield;
    }
    

    did the trick for me.

    Adding

    input::-webkit-outer-spin-button,
    input::-webkit-inner-spin-button {
        -webkit-appearance: none;
    }
    

    Would lead me to

    Unknown pseudo-class or pseudo-element ‘-webkit-outer-spin-button’. Ruleset ignored due to bad selector.

    everytime I tried. Same for the inner spin button.

提交回复
热议问题