隐藏和输入编号中的向下箭头按钮(微调器)-Firefox 29 [英] Hide Up & Down Arrow Buttons (Spinner) in Input Number - Firefox 29
问题描述
在Firefox 28上,我使用< input type ="number">
的效果很好,因为它在仅包含数字的输入字段上弹出了数字键盘.
On Firefox 28, I'm using <input type="number">
works great because it brings up the numerical keyboard on input fields which should only contain numbers.
在Firefox 29中,使用数字输入会在字段的右侧显示旋转按钮,这在我的设计中看起来像废话.我真的不需要按钮,因为当您仍然需要写6到10位数字之类的东西时,它们是无用的.
In Firefox 29, using number inputs displays spin buttons at the right side of the field, which looks like crap in my design. I really don't need the buttons, because they are useless when you need to write something like a 6~10 digit number anyway.
是否可以使用CSS或jQuery禁用此功能?
Is it possible to disable this with CSS or jQuery?
推荐答案
根据此博客帖子,您需要在 input
上设置 -moz-appearance:textfield;
.
According to this blog post, you need to set -moz-appearance:textfield;
on the input
.
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
input[type=number] {
-moz-appearance:textfield;
}
<input type="number" step="0.01"/>
这篇关于隐藏和输入编号中的向下箭头按钮(微调器)-Firefox 29的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!