直接写CSS样式是不行的
<input type="text" size="20" name="upfile" id="upfile" style="border:1px dotted #ccc">
<input type="button" value="浏览" οnclick="path.click()" style="border:1px solid #ccc;background:#fff">
<input type="file" id="path" style="display:none" οnchange="upfile.value=this.value">
写成这样,用一个text和一个button替代file,然后让file隐藏
<input type="text" size="20" name="upfile" id="upfile" style="border:1px dotted #ccc">
<input type="button" value="浏览" οnclick="path.click()" style="border:1px solid #ccc;background:#fff">
<input type="file" id="path" style="display:none" οnchange="upfile.value=this.value">
写成这样,用一个text和一个button替代file,然后让file隐藏