This CSS effectively hides the spin-button for webkit browsers (have tested it in Chrome 7.0.517.44 and Safari Version 5.0.2 (6533.18.5)):
(这个CSS有效地隐藏了webkit浏览器的旋转按钮(已在Chrome 7.0.517.44和Safari Version 5.0.2(6533.18.5)中测试过):)
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { /* display: none; <- Crashes Chrome on hover */ -webkit-appearance: none; margin: 0; /* <-- Apparently some margin are still there even though it's hidden */ } input[type=number] { -moz-appearance:textfield; /* Firefox */ }
<input type="number" step="0.01" />
You can always use the inspector (webkit, possibly Firebug for Firefox) to look for matched CSS properties for the elements you are interested in, look for Pseudo elements.
(您始终可以使用检查器(webkit,可能是Firebug for Firefox)查找您感兴趣的元素的匹配CSS属性,查找伪元素。)
This image shows results for an input element type="number": (此图显示输入元素类型=“数字”的结果:)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…