如何改变按钮的文本和颜色浏览输入文件?
问题描述:
我将输入文件设计为:
I design a input file as:
<input type="file" name="file" id="file" size="52" />
我想改变按钮Browse ..的文字和颜色。你可以帮我吗?感谢所有。
I want to change text and color of button "Browse..". Can you help me? thanks all.
答
外观和功能都可以,但这不是您真正期望的。
Appearance and functionality is ok, but this is not your real expected one. think this is help to you.
<input type="text" id="fileName" readonly="readonly" >
<div class="file_input_div" style="display: inline;">
<input type="button" id="button" value="Open"/>
<input type="file" style="opacity:0; position:relative; left:-40px;" onchange="javascript: document.getElementById ('fileName') . value = this.value"/>
</div>
CSS
CSS
#button{
position: relative;
left:-1px;
background-color:#446655;
}