Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

<input type="file"> - custom styles/css

Tags:

html

css

file-io

Is there a way to make <input type="file"> look the same in all browsers using some CSS ?

like image 496
Pydev UA Avatar asked Aug 31 '10 07:08

Pydev UA


People also ask

Can we change input type with 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.

How do you customize input in CSS?

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.

How do I style a CSS file upload button?

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.


1 Answers

Quirksmode.org has an interesting article about it: http://www.quirksmode.org/dom/inputfile.html

like image 75
Lekensteyn Avatar answered Oct 24 '22 00:10

Lekensteyn