就算我把width设为0,总有那么一点点文本框的边框,如果说border为0,我的button样式也就没了
不能变相通过text + button实现,我是迫不得已才从哪个方向转过来的

解决方案 »

  1.   

    尴尬啊 来个CSS高手吧 
      

  2.   


    <input id="File1" style="width: 57px; border-top-style: none; border-right-style: none; border-left-style: none; border-bottom-style: none;" type="file"   />
      

  3.   

    用css支持火狐和IE  <asp:FileUpload  id="fileInput"    CssClass="fileInput"  
                                       style="position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0);opacity:0;width:70px; right: 66px;" 
                                       size="12" name="fileInput"   runat="server" />                         
                                       
      

  4.   

     
    .fileInput{
    margin-left:-300px;
    font-size:30px;
    cursor:pointer;
    filter:alpha(opacity=0);
    opacity:0;
    }
      

  5.   

    <div style="display:none">
    <asp:FileUpload  id="fileInput".......
    </div>
      

  6.   

     
       <a href="javascript:void(0)"   style=" vertical-align:top"    id="UploadFile">
                         
                                    
                                  <asp:FileUpload  id="fileInput"    CssClass="fileInput"  
                                       style="position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0);opacity:0;width:70px; right: 66px;" 
                                       size="12" name="fileInput"   runat="server" />                         
                                       
                                          插入图片
                                          
                    </a>
    這樣 點擊插入圖片 其實就是點擊 上傳控件
    但是用戶看起來又不是
      

  7.   

    这样做连那个button按钮都不见了 客户端怎么点
      

  8.   

    OK 自己搞定了 谢谢wazdoyang师兄给我提供的思路,采用覆盖的思想 margin-left:-143px; 慢慢调知道把文本框完全覆盖就搞定了 
      

  9.   

    <asp:FileUpload ID="FileUpload1" style="width:0px; border:0px;" runat="server" />
      

  10.   

    还可以用 LinkButton 呀