任意美化你的文件域input type=file兼容各浏览器
css样式:
<style> .fileInput{width:102px;height:34px; background:url(http://funet8.com/img/20150411upFileBtn.png);overflow:hidden;position:relative;} .upfile{position:absolute;top:-100px;} .upFileBtn{width:102px;height:34px;opacity:0;filter:alpha(opacity=0);cursor:pointer;} </style>
HTML代码
<div class="fileInput left"> <input type="file" name="upfile" id="upfile" class="upfile" onchange="document.getElementById('upfileResult').innerHTML=this.value"/> <input class="upFileBtn" type="button" value="上传图片" onclick="document.getElementById('upfile').click()" /> </div> <span class="tip left" id="upfileResult">图片大小不超过2M,大小90*90,支持jpg、png、bmp等格式。</span>
[runcode height=”300″]
图片大小不超过2M,大小90*90,支持jpg、png、bmp等格式。
[/runcode]
原文:
http://www.cnblogs.com/dreamback/archive/2011/10/12/2208557.html
不错的~~! 感谢您提供