大家好,又见面了,我是你们的朋友全栈君。
需要提交input上传的文件等内容,所以需要form表单
HTML代码
<form id="outData">
<input type="button" id="download" value="导出数据" οnclick="">
<span id="upload"><input type="button" id="upbutton" value="上传"><input type="file" id="hidefileupload" value="导入数据"></span>
</form>
CSS样式
#outData{
width:96%;
background:#FFFFFF;
height:100%;
text-align:right;
margin:0 auto;}
#upload{
display: inline-block;
margin-top:5px;
position: relative;
overflow: hidden;
float: right;
}
#upbutton{
width:100px;
height:20px;
}
#hidefileupload{
position: absolute;
right: 0px;
top: 0px;
opacity: 0;
-ms-filter: 'alpha(opacity=0)';
}
#download{
margin-right: 20px;
width:100px;
height:20px;
float: right;
margin-top:5px;
}
浏览器显示
去掉了<input type=”file”>原本的样式。
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/160952.html原文链接:https://javaforall.cn
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有