crx349 发表于 2014-11-25 22:40:27

一个简单的上传按键样式

1.样式图片
http://www.xmspace.net/tmp/hua_43.jpg

2.css部分
<style type="text/css">
                                        .input-file {
display:inline-block;
width:85px;
height:20px;
line-height:30px;
background:#ddd;
text-align:center;
overflow:hidden;
position:relative;
background:url(images/hua_43.jpg);
}
.input-file:hover {
background:url(images/hua_43.jpg);
}
.input-file input {
opacity:0;
filter:alpha(opacity=0);
font-size:100px;
position:absolute;
top:0;
right:0;
}3.html嵌入
<a href="javascript:void(0);" class="input-file"><input name='name' type='file' size='50' data-valid-name='图片' data-valid-empty='yes' data-valid-accept='jpg,jpeg,gif,png,bmp'></a>
4.效果如下


页: [1]
查看完整版本: 一个简单的上传按键样式