可能重复:
Change cursor type on input type=“file”光标:指针不工作的输入类型的文件
这是我的jsfiddle:
这个类已经有一个光标但不工作:
.file
{
cursor:pointer;
}
我希望即使在输入类型文件内的文本框上进行悬停,它也应该更改为手形图标。但它不起作用。
有没有办法改变这种行为?
可能重复:
Change cursor type on input type=“file”光标:指针不工作的输入类型的文件
这是我的jsfiddle:
这个类已经有一个光标但不工作:
.file
{
cursor:pointer;
}
我希望即使在输入类型文件内的文本框上进行悬停,它也应该更改为手形图标。但它不起作用。
有没有办法改变这种行为?
尝试一些操作这样
HTML
<span class="file-wrapper">
<input type="file" name="photo" id="photo" />
<span class="button">Choose a File</span>
</span>
CSS
.file-wrapper {
cursor: pointer;
display: inline-block;
overflow: hidden;
position: relative;
}
.file-wrapper input {
cursor: pointer;
font-size: 100px;
filter: alpha(opacity=1);
-moz-opacity: 0.01;
opacity: 0.01;
position: absolute;
right: 0;
top: 0;
}
.file-wrapper .button {
background: #333;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
color: #fff;
cursor: pointer;
display: inline-block;
font-size: 11px;
font-weight: bold;
margin-right: 5px;
padding: 4px 18px;
text-transform: uppercase;
}
晚会有点迟,你能评论1%的不透明度而不是0吗?我找不到任何拒绝或推翻0的浏览器... – Barney
cursor:hand
是很少有老的浏览器,像IE6一样。用户cursor:pointer
代替
@Andy没有什么区别。 –
http://stackoverflow.com/questions/4112643/jquery-cursor-pointer-on-a-file-input-possible和http://stackoverflow.com/questions/1537223/change-cursor-type-on-input类型文件是相关的。 – Aziz
@安迪:是的,没错。但是这不应该有所作为。光标移动到文本框的主要问题仍然存在。 – Jack