2

I'm using the following input field

<input class="upload_button" type="file" multiple="" name="userfile">

To upload multiple files to a system, I can't work out how to style this with CSS properly, as the button and input box seem to be binded together?!

1
  • do you want to make input field beautiful? Commented Aug 30, 2012 at 13:52

4 Answers 4

3

You can't use CSS to style <input type="file"/> element directly; this is a precaution used by web browsers to prevent user's into being tricked into uploading files.

But there are techniques that work around it, using transparency that works well. http://www.quirksmode.org/dom/inputfile.html

Sign up to request clarification or add additional context in comments.

2 Comments

Wow, lot of answers very quickly - thanks everybody for your help - I'll look into the quirksmode link, seems like it would do the job nicely. Thanks Scott.
No problem. Good luck, let us know if you get stuck with anything.
0

I dont have much experience with it but i found a link which might help you: http://www.quirksmode.org/dom/inputfile.html

Comments

0

You should make type="file" multiple with z-index:-1; for example and make image appear
(with z-index:1;) in the same place where is your input file field.

Comments

0

As Scott said, you can't directly style some input elements because they are dependent on your environment (browser and OS). I have not had great luck using workarounds, and prefer solutions that replace them elegantly. One i like in particular is uniform.js.

http://uniformjs.com/

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.