input上傳按鈕的優化

在使用input標籤按鈕的時候,<input type="file" value="" />spa

顯示很難看,怎麼辦? code

使用labelblog

 
 
<li class="ware-list mt10">
    <span class="vel-tit">上傳文件:</span>
    <input class="inputText fix file_up" value="" type="text">
    <input id ="up_file" onchange="change(event)" class="inputText fix" value="" type="file" style="display:none">
    <label for="up_file"><div class="btn-primary" style="float:left;height:34px;line-height:34px" >上傳文件</div></label>
</li>

<li class="ware-list mt10"> <span class="vel-tit">上傳圖標:</span> <label for="up_img">
      <
div style="float:left;"><img ms-duplex="icon" ms-attr-src="{{icon}}"></div>
  </
label> <input id ="up_img" onchange="upimg(event)" class="inputText fix" value="" type="file" style="display:none"> <label for="up_img"><div class="btn-primary" style="float:left;height:34px;line-height:34px" >添加圖片</div></label> </li>

 
 

在上傳文件的地方:我將上傳input標籤隱藏,將上傳按鈕label到input標籤上,點擊上傳按鈕的時候,其實質是在點擊input[file]按鈕圖片

相關文章
相關標籤/搜索