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

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

问题描述

当我们使用 input="file" 时,我想更改按钮上的默认文本Choose 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 text or the orientation of the control.

如果你想要一个 / 解决方案,而不是 Flash 或 解决方案.

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

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

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

就个人而言,因为大多数用户坚持使用他们选择的浏览器,因此可能习惯于在默认呈现中看到控件,如果他们看到不同的东西(取决于您使用的用户类型),他们可能会感到困惑处理).

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天全站免登陆