简单的问题...如何更改文件输入类型上的光标类型?
我试过以下方法:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<style>
input[type="file"] {
cursor: pointer;
}
</style>
</head>
<body>
<input type="file">
</body>
</html>
出于某种原因,它不会玩球。
知道这是一个老线程。但是谷歌的结果提出了这个问题......我刚刚找到了 chrome 的部分解决方案(不涉及 flash,javascript, overflow hidden 的额外 DOM 操作)
- firefox 已修复此 bug
- safari(此时为 7)和 chrome 没有相同的行为
- safari (7, mac) 对我来说根本不起作用
- chrome(现在可能是 opera,因为它是 webkit)可以使用::webkit-file-upload-button 伪类
.
input[type=file], /* FF, IE7+, chrome (except button) */
input[type=file]::-webkit-file-upload-button { /* chromes and blink button */
cursor: pointer;
}
问题是按钮的一般不继承光标属性(?)但输入 [type=file] 字段的其余部分剂量。
这就是为什么 chrome 得到除了按钮之外的指针