簡體   English   中英

如何自定義html消息 <input type=“file”> ?

[英]How to customize html message <input type=“file”>?

我試圖自定義我的輸入類型文件的消息,看起來像這樣:

http://www.hangar-hosting.com/descargas/01.png

我需要垂直對齊中間“未選擇文件”並更改“選擇文件”和“無文件選擇”的文本

你可以這樣定制:

<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的示例中添加填充可以垂直對齊文本。 文本本身由系統生成:

http://community.mybb.com/thread-59344.html

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM