您现在的位置:首页 >> 前端 >> 内容

html自定义input type='file'样式

时间:2012/12/6 13:15:27 点击:

  核心提示:方法1:style#mybutton{border:1px solid #ccc;background:#fff;color:#000;padding:5px 15px;}/stylebr/br/in...

方法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>

 

Tags:HT TM ML L自 
作者:网络 来源:不详