1. <span class="upload_file">
    2. <span class="upload_btn">上传</span>
    3. <input type="file" name="" id="file" value="" />
    4. </span>
    1. .upload_file{
    2. position: relative;
    3. width:50px;
    4. height:20px;
    5. text-align:center;
    6. color:#fff;
    7. background:#A1A1A1;
    8. display: inline-block;
    9. overflow: hidden;
    10. }
    11. .upload_file input{
    12. position: absolute;
    13. right: 0px;
    14. top: 0px;
    15. opacity: 0;/*为了兼容ie*/
    16. -ms-filter: 'alpha(opacity=0)';
    17. }

    tip:ie8+.