解决思路是把input 放在文字的上边,弄成透明的,这样在点文字时,实际是点击了input,这样就实现了文件的上传。

具体代码:

<style>
    #uploadImg{ font-size:12px; overflow:hidden; position:absolute}
    #file{ position:absolute; z-index:100; margin-left:-180px;      font-size:60px;opacity:0;filter:alpha(opacity=0); margin-top:-5px;}
</style>
<span >
<input type="file"  >
<a href="#">上传图片</a></span>    

 

相关文章:

  • 2022-01-08
  • 2021-12-03
  • 2022-12-23
  • 2022-01-08
  • 2021-11-19
  • 2022-12-23
猜你喜欢
  • 2022-01-22
  • 2022-12-23
  • 2021-09-07
  • 2021-12-03
  • 2022-01-21
  • 2021-07-01
  • 2021-10-31
相关资源
相似解决方案