更改输入类型中的默认文本=“文件”? [英] Change default text in input type="file"?

查看:139
本文介绍了更改输入类型中的默认文本=“文件”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我们使用 input =file选择文件按钮上的默认文本>。

I want to change default text on button that is "Choose File" when we use input="file".

我该怎么做?也可以在图像按钮中看到文本的左侧。如何把它放在文本的右边?

How can I do this? Also as you can see in image button is on left side of text. How can I put it on right side of text?

推荐答案

每个浏览器都有它自己的控件的引用,所以你可以不要更改控件的测试或方向。

Each browser has it's own rendition of the control and as such you can't change either the test or the orientation of the control.

如果您希望使用html / css解决方案,则可能会尝试一些某种黑客比Flash或Silverlight解决方案。

There are some "kind of" hacks you may want to try if you want an html/css solution rather than a Flash or Silverlight solution.

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

http://www.shauninman.com/archive/2007/09/10/styling_file_inputs_with_css_and_the_dom

http://www.appelsiini.net/projects/filestyle

个人而言,因为大多数用户坚持使用浏览器,因此可能习惯于看到t他控制着默认的转换,如果他们看到不同的内容(取决于所处理的用户类型),他们可能会感到困惑。

Personally, because most users stick to their browser of choice, and therefore are probably used to seeing the control in the default rendition, they'd probably get confused if they saw something different (depending on the types of users you're dealing with).

这篇关于更改输入类型中的默认文本=“文件”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆