如何用CSS更改HTML上传字段的宽度?

ave*_*net 0 html css forms upload

我可以使用size属性更改上传字段的宽度:

<input type="file" size="20">
Run Code Online (Sandbox Code Playgroud)

但是width对于常规输入字段和其他表单控件来说效果很好的CSS 似乎没有效果,即使在Firefox上也是如此:

<input type="file" style="width: 20em">
Run Code Online (Sandbox Code Playgroud)

还有另一种方法来实现这一目标吗?

Mic*_*ael 7

我不确定这是否会有所帮助,但本文似乎深入探讨了文件输入样式的各种方式:

http://www.quirksmode.org/dom/inputfile.html