项目实际运用中对于文件选择框的样式有一定的要求,但是文件选择框本身对于样式的支持有限,所以一般的处理方式采用的是遮罩的形式,也就是使用特定的div遮盖文件选择框。
<style type="text/css">
.fileInputContainer{
height:256px;
background:url(http://images.cnblogs.com/cnblogs_com/dreamback/437546/o_ff6.png);
position:relative;
width: 256px;
}
.fileInput{
height:256px;
font-size: 300px;
position:absolute;
right:0;
top:0;
opacity: 0;
filter:alpha(opacity=0);
cursor:pointer;
}
</style>
<div class="fileInputContainer">
<input class="fileInput" type="file" name="" id="" />
</div>