您的位置:首页 > Web前端 > CSS

改变input file样式

2013-09-16 18:46 225 查看
You can't modify much about 
input[type=file]
.

Best you can do is place whatever you want to trigger it on your page, and then absolutely position the
input
 over
that with 
opacity:
0
.

The user's click on your apparent control will really trigger the invisible 
input
 on
top.

Here is how I may do it with CSS...


HTML

<div id="upload-file-container">
<input type="file" name="photo" />
</div>


CSS

#upload-file-container {
background: url(images/custom-file-input.png) no-repeat;
}

#upload-file-container input {
filter: alpha(opacity=0);
opacity: 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  html css input file image