How to remove the up and down arrow buttons with input type="number"

When I first practiced the code, I needed to implement this function. I tried it. The key is that the built-in buttons are really unsightly
. The way to remove it is very simple. Add these lines of code to the css file and it’s ok: (classname follows Change the name you wrote yourself)

/* 去掉number类型自带的加减按钮 */
.classname::-webkit-outer-spin-button,input::-webkit-inner-spin-button{
    
    
    -webkit-appearance:none;
}
.classname[type="number"]{
    
    
-moz-appearance: textfield; }

Guess you like

Origin blog.csdn.net/isfor_you/article/details/112912816