Skip to content

Commit bef704b

Browse files
author
yaoyf
committed
add the style of 'no arrow for input type=number in html5' - css.md
1 parent 212390a commit bef704b

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

css.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,4 +285,20 @@ user-select:none;
285285
- 屏蔽苹果浏览器对数字的识别[Meta标签中的format-detection属性及含义](http://blog.sina.com.cn/s/blog_51048da70101cgea.html)
286286
```html
287287
<meta content="telephone=no" name="format-detection">
288-
```
288+
```
289+
290+
- 移除HTML5 input在type="number"时的上下小箭头
291+
- 在chrome下:
292+
```css
293+
input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{
294+
-webkit-appearance: none !important;
295+
margin: 0;
296+
}
297+
```
298+
- Firefox下:
299+
```css
300+
input[type="number"]{-moz-appearance:textfield;}
301+
```
302+
303+
- 第二种方案:
304+
- 将type="number"改为type="tel",同样是数字键盘,但是没有箭头。

0 commit comments

Comments
 (0)