纯CSS定义input file样式及上传图片预览 CSS

来源:互联网 发布:php常用的谷歌插件 编辑:程序博客网 时间:2024/06/05 11:57
<style type="text/css">    .upfile{cursor:pointer;direction:rtl;height:30px;opacity:0;width:90px;filter:alpha(opacity=0); position:absolute;top:0;left:0}    a{        position:relative;cursor:pointer;display:block;height:30px;cursor:pointer;margin-top:7px;overflow:hidden;width:90px;background:#fefefe;border:1px solid #dcdcdc;line-height:30px;text-align:center;font-size:14px;color:#333;text-decoration:none;border-radius:5px;        background:-moz-linear-gradient(center top,#ffffff,#f6f6f6 50%,#f6f6f6 50%,#ededed);        background:-o-linear-gradient(top left,#ffffff,#f6f6f6 50%,#f6f6f6 50%,#ededed);        background:-webkit-gradient(linear,0% 0,0% 100%,from( #ffffff),to( #f6f6f6),color-stop(.5,#f6f6f6),color-stop(.5,#ededed));        filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff',endColorstr='#ededed');        -ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#ffffff', endColorstr='#ededed')";    }    a:hover{        background:-moz-linear-gradient(center top,#f9f9f9,#efefef 50%,#efefef 50%,#e4e4e4);        background:-o-linear-gradient(top left,#f9f9f9,#efefef 50%,#efefef 50%,#e4e4e4);        background:-webkit-gradient(linear,0% 0,0% 100%,from( #f9f9f9),to( #efefef),color-stop(.5,#efefef),color-stop(.5,#e4e4e4));        filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f9f9f9',endColorstr='#e4e4e4');        -ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#f9f9f9', endColorstr='#e4e4e4')";    }</style><a href="javascript:void(0);"><input type="file" class="upfile"><span>上传图片</span></a>
0 0
原创粉丝点击