Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Style button in upload type

Tags:

css

I have a style that I apply to my buttons. Can I apply the same style to the button of the file upload element without affecting the entry field?

<input type="file" name="myFile">
like image 209
santa Avatar asked Feb 24 '23 12:02

santa


2 Answers

The designing of file element is not supported by almost all browser. Some browser allow it and some browser does not allow it.

You can not make it browser compatible. Basically you do not have complete control to design it.

You can also go with this article

like image 70
Shakti Singh Avatar answered May 05 '23 17:05

Shakti Singh


Due to security concerns, browsers doesn't allow you to edit or style the upload button. It can be exploited to trick the user. Example

like image 42
Jaspero Avatar answered May 05 '23 18:05

Jaspero