How to style contact form 7 file input buttons

Reece picture Reece · Oct 25, 2017 · Viewed 17.2k times · Source

I can't seem to target the button for up loading a file within contact form 7. How can I target the choose file button so I can add a background-color etc. Oh I am also doing this is WordPress incase you need to know that. So in the backend it looks like this;

<label class="form_label"> Your Name<span>*</span>
[text* your-name]</label>

<label class="form_label"> Your Email<span>*</span>
[email* your-email]</label>

<label class="form_label">Tel
[tel tel]</label>

<label class="form_label">CV<span>*</span>
[file cv id:upload]</label>

<label class="form_label">Cover Letter
[textarea your-message]</label>

[submit "Send"]

My output html looks like below.

Answer

Lilliam picture Lilliam · Jan 22, 2019

I had to change visibility:hidden; by opacity:0;

according to https://www.quirksmode.org/dom/inputfile.html so to the button continues to work otherwise the click didn't prompt the browse.