5

Possible Duplicate:
Change cursor type on input type=“file”</a>

This is my jsfiddle:

http://jsfiddle.net/3zNMK/

This class already has a cursor but not working:

.file
{
    cursor:pointer;
}

I want that even though a hover is made on textbox inside input type file, it should change to hand icon. But it is not working.

Any way to change this behavior?

4

3 回答 3

6

尝试一些这样的操作

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;
}
​

演示

于 2012-11-06T10:41:19.150 回答
0

cursor:handIE6 等少数老浏览器都能理解。cursor:pointer而是用户

于 2012-11-06T10:36:19.203 回答
0

你用cursor:hand;你的小提琴,这是过时的。

如果你使用cursor:pointer;,当你悬停输入时会出现手形光标。

于 2012-11-06T10:35:07.053 回答