【发布时间】:2012-03-22 16:58:44
【问题描述】:
按照question 中的 CSS 样式技巧,我能够创建一个自定义上传按钮。现在,挑战是让按钮的整个部分将鼠标指针图标更改为手形。
可以看到我部分实现这一点的方式here (jSFiddle)。如您所见,当鼠标悬停在按钮的右侧区域时,光标仅显示为一只手(我使用的是最新版本的 Firefox)。
<span id="uploadMask">
<input type="file" multiple="multiple" name="file" id="file_upload">
<span class="button">Select Documents</span>
</span>
#uploadMask {
width:160px;
display: block;
float:left;
overflow: hidden;
height:32px;
margin-right: 5px;
position: relative;
}
#uploadMask input {
position: absolute;
top:0;
bottom: 0;
right:0;
opacity: 0;
z-index: 2;
cursor: pointer;
}
#uploadMask .button {
background:#ccc;
line-height:24px;
padding:5px 15px;
display:block;
}
有什么想法吗?
【问题讨论】:
标签: html css file-upload