2012-08-22 64 views

回答

1

试试这个办法:

  1. 覆盖输入文件的顶部一个div。
  2. 更改输入文件的不透明度为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/

0

如果你在谈论一个<input type=file />的浏览按钮,也无法做到这一点。你必须去一个jQuery/ajax文件上传插件,用自定义的东西替换原来的按钮。看看这里的列表:

http://creativefan.com/10-ajax-jquery-file-uploaders/

,看看你是否找到你喜欢的东西。

相关问题