Html 定制<;输入类型=“;文件”>;?
我需要在表单中添加一些自定义的Html 定制<;输入类型=“;文件”>;?,html,css,Html,Css,我需要在表单中添加一些自定义的 我试着使用这个代码 <div id="upload-file-container"> <input type="file" name="pic[]" class="photo" value="Add photo" /> </div> 但我的输入却变得看不见了。 如何使输入标题“添加照片”可见?请看以下内容:。您的输入需要是不可见的不透明度:0,因为您不能在其中应用任何样式或自定义文本。您需要将可见内容置于其下方出于
我试着使用这个代码
<div id="upload-file-container">
<input type="file" name="pic[]" class="photo" value="Add photo" />
</div>
但我的输入却变得看不见了。如何使输入标题“添加照片”可见?请看以下内容:。您的输入需要是不可见的
不透明度:0
,因为您不能在其中应用任何样式或自定义文本。您需要将可见内容置于其下方出于安全原因,您无法更改该文件类型的值,因为您告诉它们不可见(不透明度:0;
)
#upload-file-container {
position: relative;
width: 50px;
height: 20px;
overflow: hidden;
}
#upload-file-container input {
position: absolute;
left: 0;
top: 0;
font-size: 20px;
opacity: 0;
margin: 0;
padding: 0;
border: none;
width: 50px;
height: 20px;
}