input,type=”file”的样式修改
1.样式
2.dom
<div class="costs-uploadfile-div">
<input type="file" name="file" id="fileField" onchange="document.getElementById('textfield').value=this.value" />
<input type='text' id="textfield" />
<button class="allBtn costs-marl15">浏览</button>
<button class="allBtn costs-marl15">上传</button>
</div>
3.css
.costs-marl15{margin-left: 15px;}
div.costs-uploadfile-div{
position:relative;
}
div.costs-uploadfile-div #textfield{
width:150px;
height:30px;
}
div.costs-uploadfile-div #fileField{
width:245px;
height:30px;
position: absolute;
top: 0;
left:0;
filter: alpha(opacity:0);
opacity: 0;
}
div.costs-uploadfile-div .allBtn{
padding:0;
margin:0;
height: 30px;
line-height: 30px;
width: 80px;
background-color: #18b3cf;
border: none;
color: #fff;
}