请参阅以下链接:
不知道为什么这需要双击以及如何修改它以单击一次。该问题仅发生在 IE 中,它适用于 Mozilla。
HTML:
<div class="custom-input-file">
<input type="hidden" value="10000000" name="MAX_FILE_SIZE" />
<input class="input-file" type="file" size="1" onchange="readURL(this);" multiple="multiple" name="files[]" />
Choose files
</div>
CSS
.custom-input-file .input-file {
margin: 0;
padding: 0;
outline: 0;
font-size: 10000px;
border: 10000px solid transparent;
opacity: 0;
filter: alpha(opacity=0);
position: absolute;
right: -1000px;
top: -1000px;
cursor: pointer;
}
.custom-input-file {
overflow: hidden;
position: relative;
cursor: pointer;
}
.custom-input-file {
background-color:yellow;
width: 229px;
height: 29px;
font-family: "Tw Cen MT";
font-weight: bold;
font-size: 18px;
text-align: center;
padding-top: 7px;
margin: 0 auto;
color:black;
}