两个办法:
-
style="display:none;"
<button onclick="chooseFile.click()">上传文件</button>
<input type="file" id="chooseFile" style="display:none;">
-
设置透明的opacity: 0;
.upload_pic11 { //改成自己的类名 width: 100%; height: 400px; position: absolute; left: 0; top: 80px; opacity: 0; background-color: aquamarine; z-index: 99; cursor: pointer; }
总结
尝试了n+1种方法,以上方法,亲测有效!!!