HTML File upload field style

后端 未结 5 1844
旧时难觅i
旧时难觅i 2021-01-19 03:10

I am trying to create a file upload field that has a little bit of style to it, but I seem to be having problems finding examples of this. I know part of the reason is that

5条回答
  •  醉梦人生
    2021-01-19 03:54

    I have come up on this problem before. Unfortunately, file uploads are nearly impossible to style consistently across browsers. As of CSS 2, I think, the W3C standard specifically leaves behavior undefined--think of how many ways it would need to be implemented on different platforms. Firefox, for example, generates anonymous button and input elements inside the file upload element which only inherit some of the properties that you set on the upload element itself.

    You can get some to work using, for example, Furuno's method, but know that the behavior will be spotty and differ widely across platforms/browsers.

提交回复
热议问题