这个问题用中文搜目前没有答案,在Stack Overflow上面找到了答案。
可以打开的各位请自行阅读:html - Change cursor type on input type="file" - Stack Overflow
不能打开的,方案如下:
Know this a old thread. But the google results brings this up... I Just found a partial solution to chrome (not invalving flash, javascript, extra DOM manipulation with overflow hidden)
- firefox has fixed this bug
- safari (7 at this moment) and chrome dosen't have identical behavior
- safari (7, mac) dosen't work at all for me
- chrome (and maybe opera now when it's webkit) can use ::webkit-file-upload-button pseudo-class
.
input[type=file], /* FF, IE7+, chrome (except button) */
input[type=file]::-webkit-file-upload-button { /* chromes and blink button */
cursor: pointer;
}
The problem is that button's doesn't inherit the cursor property in general(?) but the rest of the input[type=file] field dose. Thats why chrome get the pointer except the button
简单翻译一下,这个问题 火狐已经修复了
但是 chrome 并没有,
造成这个问题的原因是,之前这个按钮没有继承 cursor 属性。