Do you have a question? Post it now! No Registration Necessary. Now with pictures!
May 23, 2005, 6:08 am
rate this thread
Re: little question
Nitpick - that doesn't "give focus" to the element, it just changes
the style of the element when it recieves focus.
(And of course IE doesn't support attribute selectors or the :focus
pseudo class, but you probably know that)
The file input is effectively unstylable. As most (but not all)
browsers display it as a combination of two widgets and as CSS
doesn't provide any way to address those two widgets independently
there's no not a lot you can do.
(Also would you want the focus state to be triggered when the focus
was on the textbox widget or the button widget or both?)
Some people go down a rather convoluted route whereby they hide the
actual <input type="file"> and instead have a standard text input and
a standard button that can be styled independently. They then use
real, hidden input and the fake, visible ones.
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor