有没有办法改变文件输入中按钮的颜色?

问题描述 投票:0回答:1

对于文件输入 (

<input type="file">
),有一个按钮显示“选择文件”。

它的颜色是灰色的,我想改变那个颜色。由于从技术上讲,它本身并不是一个

<button>
元素,因此适用于
<button>
元素的任何样式都不适用于此元素。在检查器中,没有任何迹象表明该按钮存在,因此 UA 必须默认为文件输入提供该按钮。不过,我确实在 Pinetools 上看到了不同的按钮颜色,所以这一定是可能的。

我不知道该怎么做,所以欢迎任何想法!

css html-input
1个回答
0
投票
 <label htmlFor='resume_file'>
      <h6>Acceptable files: docx,pdf</h6>
       <Container className='job_form_resume_box'>
          <h6>Drag and drop here, or</h6>
           <h6>Select a file</h6>
       </Container>
      <input type='file' accept=".docx,.pdf" /> 

 </label>
© www.soinside.com 2019 - 2024. All rights reserved.