input type= file 如何更改自定义的样式

  • A+
所属分类:js 前端

1
2
3
4
5
6
7
input {
@include wh(24px,22px);//sass 宽高
@include pa(0,0);      //绝对定位 top:0;left:0;
opacity: 0;            //透明度;
overflow: hidden;
 }
让input type=file 文件改变宽高,透明绝对定位在 点击按钮或者图标的下边,就可以美化自定义上传的文件了;

 

1、项目碰到上传文件,自定义的文件很大,样式丑陋,如何更改

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<ul class="chat-dialog-tools-list clr" id="carousel">
                   <li @click.stop="toggleEm($event)">
                       <i class="icons em-icon" title="选择表情"></i>
                   </li>
                   <li>
    
                       <i class="icons pic-icon">
                           <!--<input type="file" id="selectFile" @change="sendFile()"  accept="image/jpeg, image/gif, image/x-ms-bmp, image/x-png">-->
                           <input type="file" id="selectImage" title="发送图片" accept="image/jpeg, image/gif, image/x-ms-bmp, image/x-png">
                       </i>
                   </li>
                   <li @click.stop="doCapture()">
                       <i class="icons cut-icon" title="屏幕截图"></i>
                   </li>
    
                   <li>
                       <i class="icons file-icon" title="发送文件">
                           <!--<input type="file" id="selectFile" >-->
                       </i>
                   </li>
                   <li>
                       <i class="icons mail-icon" title="发送邮件">
    
                       </i>
                   </li>
                   <li>
                       <i class="icons news-icon" title="历史消息"></i>
                   </li>
                   <li class="chat-dialog-video">
                       <i class="icons video-icon" title="视频通话"></i>
                   </li>
                   <li class="chat-dialog-voice">
                       <i class="icons voice-icon" title="音频通话"></i>
                   </li>
    
               </ul><br><br><br><br><br>

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: