去除input默认的加减号_input属性为number时,如何去掉+、-号?
input标签有type=number的时候,默认情况下有加减号的功能 ,那么,怎么去掉这个别扭的东西呢?
首先想到的是用 type =”tel” 这样移动端同样会调出数字输入键盘, 而且也不存在加减按钮
/* 谷歌 */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none;
appearance: none;
margin: 0;
}
/* 火狐 */
input{
-moz-appearance:textfield;
}
本文内容仅供个人学习/研究/参考使用,不构成任何决策建议或专业指导。分享/转载时请标明原文来源,同时请勿将内容用于商业售卖、虚假宣传等非学习用途哦~感谢您的理解与支持!