Is there a way to make <input type="file">
look the same in all browsers using some CSS ?
No. CSS is a presentation language. It cannot be used to alter the semantics and structure of a document. The closest you could come would be to determine which if a file and date input were visible in the document.
Styling Input Fields If you only want to style a specific input type, you can use attribute selectors: input[type=text] - will only select text fields. input[type=password] - will only select password fields. input[type=number] - will only select number fields.
Styling the upload file button By default, the Choose file button has a plain user-agent style. To style the button with CSS you should use the ::file-selector-button pseudo-element to select it. It is supported in all modern browsers.
Quirksmode.org has an interesting article about it: http://www.quirksmode.org/dom/inputfile.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With