如何用图片按钮来代替文件上传控件

点击图片时,弹出窗口,让上传文件

<style type="text/css">

    .fileInputContainer{
        height:256px;
        background:url(http://images.cnblogs.com/cnblogs_com/dreamback/437546/o_ff6.png);
        position:relative;
        width: 256px;
    }
    .fileInput{
        height:256px;
        font-size: 300px;
        position:absolute;
        right:0;
        top:0;
        opacity: 0;
        filter:alpha(opacity=0);
        cursor:pointer;
    }

</style>
<div class="fileInputContainer">
    <input class="fileInput" type="file" name="" id="" />
</div>

实现原理是:用图片盖住input上传文件控件。

保留住,以后可能会用到。

posted @ 2013-04-09 17:53  KoMiles  阅读(12283)  评论(3编辑  收藏  举报