skip to Main Content

I need to change the color of the Choose File.
I tried the following code, but it only changes No file chosen.
Would you please let me know how to change the color?

.hide-if-value input {
  color: red!important;
}
<div class="hide-if-value">
  <label class="acf-basic-uploader">
        <input type="file" name="acf[field_60bc599999c5]" id="acf-field_60bc599999c5">
   </label>
</div>

enter image description here

Thank you.

2

Answers


  1. You can make use of ::file-selector-button since the upload button is part of the pseudo-element.

    .hide-if-value input[type=file]::file-selector-button {
      color: red;
    }
    <div class="hide-if-value">
      <label class="acf-basic-uploader">
                <input type="file" name="acf[field_60bc599999c5]" id="acf-field_60bc599999c5">
          </label>
    </div>
    Login or Signup to reply.
  2. you can try this code.

    input[type=file]::file-selector-button {color: #069e08; }

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search