I want to change default text on button that is "Choose File
" when we use input="file"
.
How can I do this? Also as you can see in image button is on left side of text. How can I put it on right side of text?
I want to change default text on button that is "Choose File
" when we use input="file"
.
How can I do this? Also as you can see in image button is on left side of text. How can I put it on right side of text?
Ok so very simple pure css way of creating your custom input file.
Use labels, but as you know from previous answers, label doesn't invoke onclick function in firefox, may be a bug but doesn't matter with the following.
What you do is style the label to look how you want it to
now simply hide the actual input button, but you cant set it to to
visability: hidden
So make in invisible by setting
opacity: 0;
now as you might have noticed i have the same class on my label as i do my input field, that is because i want the to both have the same styling, thus where ever you click on the label, you are actually clicking on the invisible input field.
This should work:
input.className::-webkit-file-upload-button { style content.. }