87,992
社区成员
发帖
与我相关
我的任务
分享
<!doctype html>
<html>
<head>
<title></title>
<style>
.fileUpload{
width:100px;
height:25px;
position: relative;
vertical-align: middle;
text-align: center;
overflow: hidden;
background: black;
color: white;
float: left;
}
.fileUpload span {
display: block;
position: relative;
width:100%;
height:100%;
}
.fileUpload input[type=file] {
position: absolute;
top: 0px;
right: 0px;
margin: 0px;
display: block;
transform: translate(-300px, 0) scale(4);
cursor: pointer;
opacity: 0;
filter: alpha(opacity=0);
direction: ltr;
width: 100%;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
-o-user-select: none;
}
</style>
</head>
<body>
<span class="fileUpload">
<span>Upload</span>
<input type="file"/>
</span>
</body>
</html>
这是把上传控件透明掉 可以直接调用事件