<分区>
Possible Duplicate:
Change cursor type on input type=“file”
这是我的 jsfiddle:
这个类已经有一个游标但是没有工作:
.file
{
cursor:pointer;
}
我希望即使悬停在输入类型文件内的文本框上,它也应该变为手形图标。但它不起作用。
有什么办法可以改变这种行为?
标签 javascript jquery html css
<分区>
Possible Duplicate:
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;
}
关于javascript - 光标 :pointer not working on input type file,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13249103/