<input type="file" style="position:absolute;filter:alpha(opacity=0)" hideFocus onpropertychange="document.getElementById('ice').value=this.value"/>
<input type="text" style="width:152px" id="ice"/>
<img src="http://community.csdn.net/logo/images/ajax-in-action.JPG" height="20" align="absmiddle"/>

解决方案 »

  1.   

    http://www.blueidea.com/bbs/NewsDetail.asp?id=1227402
      

  2.   

    <input id=a size=20><span  style="width:100;" >选择文件</span>
    <div style="position:absolute;top:15;left:-80;width:150;filter:alpha(opacity=0)" >
    <input type="file" onpropertychange="a.value=this.value" size=33></div>
      

  3.   

    <script>
    function fclick(obj){
      with(obj){
        style.posTop=event.srcElement.offsetTop
        var x=event.x-offsetWidth/2
        if(x<event.srcElement.offsetLeft)x=event.srcElement.offsetLeft
        if(x>event.srcElement.offsetLeft+event.srcElement.offsetWidth-offsetWidth)x=event.srcElement.offsetLeft+event.srcElement.offsetWidth-offsetWidth
        style.posLeft=x
      }
    }
    </script>
    <style>
    input{border:1px solid #333333;color:#666666;background:#eeeeee;font:normal 12px Tahoma;height:18px}
    </style>
    <form method="post" action="" enctype="multipart/form-data">
    <input id="f_file">&nbsp;<input type="button" onmouseover="fclick(t_file)" value="选择上传文件">
    <input name="upload" type="file" style="position:absolute;filter:alpha(opacity=30);width:30px;" id="t_file" onchange="f_file.value=this.value" hidefocus>
    <br><input type="submit" value="提交">
    </form>
      

  4.   

    <input type="file" style="border:1px solid blue;color:red;background:green;font:bold 12px '隶书';height:18px;width:160px">
      

  5.   

    绝对位置的问题,应该根据实际位置设置TOP,LEFT
      

  6.   

    另外,用遮罩感觉总不是个好办法。最好还是利用TYPE=FILE本身的属性,谁有时间查一下。
      

  7.   

    M$考虑安全问题,TYPE=FILE 没有这个属性。说不定哪天,把 TYPE=FILE 的z-index设置无限高,不允许任何层盖那更惨了。
      

  8.   

    用模拟来实现
    先把input=file的隐藏,再用文本框来实现