<style>
/*在chrome下移除input[number]的上下箭头*/
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button{
-webkit-appearance: none !important;
margin: 0;
}
/*在firefox下移除input[number]的上下箭头*/
input[type="number"]{-moz-appearance:textfield;}
<style>
<input type="number" oninput="if(value.length>5)value=value.slice(0,5)">
本文介绍如何通过CSS样式禁用浏览器中输入框的上下箭头,并提供了一个具体的代码示例,其中包括了Chrome和Firefox浏览器的兼容性处理。
1986

被折叠的 条评论
为什么被折叠?



