【发布时间】:2017-06-23 06:55:21
【问题描述】:
我有一个用于文件上传的input 元素(type='file')。我正在尝试在其中添加一些样式,并且几乎可以正常工作。将鼠标悬停在图像上时,我无法将光标更改为pointer。只有当光标在图像底部时才会出现。
div.wrapper{
position:relative;
height: 40px;
}
div.upload {position:absolute;
background: url('https://cdn1.iconfinder.com/data/icons/Momentum_GlossyEntireSet/32/folder_open-add.png') 0 0 no-repeat;
}
div.upload input {
width: 40px;
height: 40px;
opacity: 0;
cursor: pointer;
}
#fileDesc{
top:10px;
position:relative;
margin-left:0px;
font-family: Trebuchet MS,Helvetica,Arial,sans-serif;
font-size:18px;
color:#3383bb;
}
<div class="wrapper">
<div class="upload">
<input type="file" name="upload" id="uploader"><span id="fileDesc">No file selected...</span>
</div>
</div>
<input id="parseXml" type="button" value="Load file" onClick="parseXml()" style="vertical-align: top" />
【问题讨论】:
-
这个jsfiddle.net/detst0kc 呢???
-
我的问题可能不清楚,我希望文件夹的图像有一个指针光标。在我的代码中它确实如此,但(出于未知原因)仅在图像的下半部分。
标签: html css html-input