<style type="text/css">
.selectbtn .s2 {
left: 0;
overflow: hidden;
top: 6px;
}
.selectbtn .s1, .selectbtn .s2 {
// background: url("../images/scbg.png") no-repeat scroll 0 0 rgba(0, 0, 0, 0);
border: 0 none;
color: #fff;
display: block;
font-size: 16px;
font-weight: bold;
height: 34px;
line-height: 32px;
position: relative;
text-align: center;
width: 100px;
}
.selectbtn .btns {
border: 1px solid #000;
display: block;
height: 27px;
left: -35px;
opacity: 0;
position: absolute;
top: 0;
width: 110px;
z-index: 9999;
}
.selectbtn {
font-family: "Microsoft YaHei",微软雅黑,Arial,Helvetica,sans-serif;
height: 80px;
margin: 20px auto;
position: relative;
width: 427px;
}
</style>
html:
<div class="form-group selectbtn">
<div class="s1">
<span class="btn btn-default">本地上传</span>
<input id="file" class="btns" type="file" οnchange="ajaxFileUpload(this);" value="上传" name="file">
</div>
</div>
这样就达到了隐藏file的目的
html css隐藏input的file特性
最新推荐文章于 2024-06-06 10:36:09 发布