日期:2014-05-17  浏览次数:20524 次

html自定义input type='file'样式
方法1:
<style>
#mybutton{
	border:1px solid #ccc;
	background:#fff;
	color:#000;
	padding:5px 15px;
}
</style><br/><br/>
<input type="file" id="file" onchange="" style="display:none"/>
<input type="button" onclick="file.click()" id="mybutton" value="浏览"/>


方法2:

<a href="javascript:file.click();" style="background:url(https://passport.csdn.net/images/btnsel.gif) no-repeat;width:120px;height:42px;display:block;">
	<input type="file" id="file" style="display:none;"/>
</a>


示例:

http://www.zhjie.net/html-input-type-file-custom-button-styles.htm