CSS自定义上传文件按钮样式(兼容I6+)

参考网址:http://www.alleyloft.com/contents/share?id=14
<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <title>demo</title>
    <style>
        *{margin: 0;padding: 0;}
            .box{
                position:relative;
                float:left;
                overflow:hidden;
            }
            input.uploadFile{
                position:absolute;
                right:0px;
                top:0px;
                opacity:0;
                filter:alpha(opacity=0);
                cursor:pointer;
                width:276px;
                height:36px;
                overflow: hidden;
            }
            a.link{
                float:left;
                display:inline-block;
                padding:4px 16px;
                color:#fff;
                font:14px "Microsoft YaHei", Verdana, Geneva, sans-serif;
                cursor:pointer;
                line-height:28px;
                text-decoration:none;
            }
    </style>
</head>
<body>
    <div class="box">
         <a href="javascript:;"  class="link">浏览</a>
         <input ty pe="file" class="uploadFile"  onchange="getFile(this,‘copyFile‘)">
    </div>
</body>
</html>

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。