views:

31

answers:

2

How do I properly style a 'file' button with an image, so that it is seen clean and nice in all browsers and no overlapping text from the default control is there?

Thank you!

+1  A: 

The way it's usually done is by making the file input element 100% transparent with the css opacity property and putting a pretty button behind it. That way the file field still receives the click, but the look of the underlying element can be styled and scripted any way you want.

no
Is it necessary for me to use JavaScript or HTML and CSS would be sufficient?
vlevsha
It all works. Thank you!
vlevsha
A: 

File buttons are a major headache. I personally would use http://swfupload.org/

Casey
There is Flash involved with SWFUpload.Won't it prevent the button to be seen in iPhone/iPad?
vlevsha
How will you browse for and select files to upload from your iPhone/iPad?
Casey
Fair question. :)
vlevsha