gpt4 book ai didi

html - 自定义<输入类型=“file”>?

转载 作者:行者123 更新时间:2023-11-28 12:08:35 27 4
gpt4 key购买 nike

我需要在我的表单中添加一些自定义的 <input type=“file”>
enter image description here

我尝试使用这段代码

<div id="upload-file-container">
<input type="file" name="pic[]" class="photo" value="Add photo" />
</div>

CSS

#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;
}

但我的输入变得不可见了。
http://jsfiddle.net/FXTCg/4/
如何使输入标题“添加照片”可见?

最佳答案

看看这个:http://jsfiddle.net/gabrieleromanato/mxq9R/ .您的输入需要不可见 opacity: 0 因为您不能在其中应用任何样式或自定义文本。你需要把你可见的内容放在它下面

关于html - 自定义<输入类型=“file”>?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19609199/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com