[英]How to customize html message <input type=“file”>?
我试图自定义我的输入类型文件的消息,看起来像这样:
我需要垂直对齐中间“未选择文件”并更改“选择文件”和“无文件选择”的文本
你可以这样定制:
<style type="text/css">
#upload-file-container input {
filter: alpha(opacity=0);
opacity: 0;
}
</style>
<br />
<label>Please click the Image to Upload a file:</label>
<div id="upload-file-container">
<input type="file" name="photo" />
</div>
http://jsfiddle.net/5rp5e/2/ (工作示例)
<div id="background">
<input type="file" value="choose file" />
</div>
CSS:
#background{
padding:20px;
background: #ccc;
width: 300px; /* or whatever you want it to be */
}
在Evan的示例中添加填充可以垂直对齐文本。 文本本身由系统生成:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.