Is there a way to set width of <input type='file'/> for showing in Firefox?

爷,独闯天下 提交于 2019-12-08 14:53:55

问题


All the CSS attributes apply to the <input type='file'/> don't work on FF, but work on most other browsers.

Just can't even set the width. Any solution? No JS please.


回答1:


Have you set the size attribute?

<input type="file" name="datafile" size="40">

Firefox doesn't support setting the size via CSS.




回答2:


I wouldn't have a clue if anyone still finds this thread, but just in case...

input[type="file"] {
max-width: 100%;
}

...worked for me. Cuts the overlap off, but at least it doesn't over- or underlap anymore




回答3:


What if

<input type="file" name="file_to_upload" id="file_to_upload" style="max-width:75px;"> 

For me works in FF 37.0.1. But possibly in older versions does not work



来源:https://stackoverflow.com/questions/8266358/is-there-a-way-to-set-width-of-input-type-file-for-showing-in-firefox

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!