<style type="text/css">
.input-file {
display:inline-block;
width:120px;
height:40px;
line-height:40px;
background:#337ab7;
text-align:center;
overflow:hidden;
position:relative;
font-weight:600;
color:#fff;
font-size:14px;
}
.input-file:hover {
background:#337ab7;
}
.input-file input {
opacity:0;
filter:alpha(opacity=0);
height:40px;
width:100%;
position:absolute;
top:0;
right:0;
cursor:hand;
}
</style>
</head>
<body>
<span class="input-file" >上传文件
<input type="file" id="excelFile" name="excelFile"/>
</span>
</body>
得到效果图: