HTML:
<form id="imgFile" action="" method="post" enctype="multipart/form-data"> <a href="javascript:void(0);" class="file"> 上传头像 <input type="file" name="rp_pic_file" class="rp_pic_btn" id="upload_pic"> </a> </form>
CSS:
.file { position: relative; display: inline-block; padding: 0; overflow: hidden; text-decoration: none; text-indent: 0; width:158px; height:50px; line-height:50px; -webkit-border-radius:20px; -moz-border-radius:20px; border-radius:20px; text-align: center; border: none; color: #000000; font-size:16px; background: #ffe400; } .file input { position: absolute; font-size: 100px; right: 0; top: 0; opacity: 0; filter: alpha(opacity=0); }
时间: 2024-11-01 01:16:52