html - 文件输入占位符
问题描述
我想用“cv”代替“没有选择文件”,我试图在文件输入上添加占位符,但它不起作用
<div class="col-md-6 form-group ">
<input type="file" class="col form-control text-field-box mt-3" name="cv" id="files" placeholder="CV" accept="application/pdf" required />
<label class="ml-3 "
style="font-size: 13px;position: absolute;top: 0px;
font-family: 'Roboto', sans-serif;font-weight: 300;">CV</label>
</div>
解决方案
请仔细检查我的代码,如果您对此有任何疑问,请告诉我。:)
希望它会帮助你。
.file-wrapper .col.form-control{
height: 20px;
background: transparent;
border: 0;
position: absolute;
left: 0;
opacity: 0;
top: 0;
bottom: 0;
width: 100%;
z-index: 1;
}
.file-wrapper .ml-3{
font-size: 13px;
position: relative;
top: 0px;
font-family: 'Roboto', sans-serif;
font-weight: 300;
z-index: 0;
}
<div class="col-md-6 form-group file-wrapper">
<input type="file" class="col form-control text-field-box mt-3" name="cv" id="files" placeholder="CV" accept="application/pdf" required />
<label class="ml-3 "
style="font-size: 13px;position: absolute;top: 0px;
font-family: 'Roboto', sans-serif;font-weight: 300;">CV</label>
</div>
推荐阅读
- reactjs - 在 React 中如何允许在同一个 wifi 或网络中的其他人访问 localhost:3000
- python - 使用Python确定简单图像中某些颜色/曲线的像素“长度”数?
- openstack - Openstack octavia:数据库初始化
- html - 居中图像时 Flexbox 高度增加
- python - 以表单输入,然后将其与存储在 django 中的数据库中的值进行比较
- html - CSS background-image 属性可以用来调整背景图片的大小吗?
- cellular-automata - 自初始化元胞自动机
- java - spring boot 数据库错误数据源“org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration”
- sql - 在 SQL 中正确存储多个断开连接的数据集
- java - 在 BroadcastReceiver 上禁用 10 秒超时。安卓开发