Replace input type=file by an image

后端 未结 13 2065
感动是毒
感动是毒 2020-12-02 04:13

Like a lot of people, I\'d like to customize the ugly input type=file, and I know that it can\'t be done without some hacks and/or javascript. But,

相关标签:
13条回答
  • 2020-12-02 04:53

    The input itself is hidden with CSS visibility:hidden.

    Then you can have whatever element you whish - anchor or image.., when the anchor/image is clicked, trigger a click on the hidden input field - the dialog box for selecting a file will appear.

    EDIT: Actually it works in Chrome and Safari, I just noticed that is not the case in FF4Beta

    0 讨论(0)
提交回复
热议问题