标签:type lock position inpu pos 3.2 button accept display
input file 把之前的按钮透明度opacity设置为0,外层用div包裹。
1 <div class="uploadButDiv greenButton text-center"> 2 <input type="file" accept="image/jpeg,image/jpg,image/png,image/gif"/>上传 4 </div>
.uploadButDiv { width: 100%; height: 3.25rem; line-height: 3.2rem; position: relative; cursor: pointer; color: #0057FF; font-size: 1.125rem; background: #fff; border: 1px solid #0057FF; border-radius: 4px; overflow: hidden; display: inline-block; } .uploadButDiv input { width: 100%; position: absolute; right: 0; top: 0; opacity: 0; cursor: pointer }
标签:type lock position inpu pos 3.2 button accept display
原文地址:http://www.cnblogs.com/Evo1uti0n/p/7606532.html