如何将浏览按钮设置为看起来像一个链接?
我的意思是
<input type=file />
试试这个方法:
将输入文件的不透明度更改为 0。
div.text {
position: absolute;
top: 0;
left: 0;
text-decoration: underline;
color: blue;
}
div.wrapper {
position: relative;
}
input { opacity: 0; }
<div class="wrapper">
<div class="text">I'm not a link you fool</div>
<input type="file"/>
</div>
演示:http: //jsfiddle.net/codef0rmer/BZeMG/
本教程应该对你有所帮助,
如果您谈论的是 a 的浏览按钮,<input type=file />
则不能这样做。你必须去一个 jquery/ajax 文件上传插件,用自定义的东西替换原来的按钮。看看这里的列表:
http://creativefan.com/10-ajax-jquery-file-uploaders/
看看你是否找到你喜欢的东西。