html – bootstrap 4中的自定义输入文件不显示按钮

前端之家收集整理的这篇文章主要介绍了html – bootstrap 4中的自定义输入文件不显示按钮前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
当我在bootstrap 4中使用自定义输入文件时,请不要更改我的输入,也不要显示浏览按钮.

file-browser

<label class="custom-file">
    <input type="file" id="Image" class="custom-file-input">
    <span class="custom-file-control"></span>
</label>

.custom文件

position: relative;
display: inline-block;
max-width: 100%;
height: 2.5rem;
cursor: pointer;

.custom文件输入

min-width: 14rem;
max-width: 100%;
margin: 0;
filter: alpha(opacity=0);
opacity: 0;

.custom文件控制

position: absolute;
top: 0;
left: 0;
right: 0;
z-index: 5;
height: 2.5rem;
padding: .5rem 1rem;
line-height: 1.5;
color: #555;
user-select: none;
background-color: #fff;
border: 1px solid #ddd;
border-radius: .25rem;

解决方法

据我所检查 – 你需要插入:之前和:之后的伪元素 – 然后它的工作原理.
.custom-file-control:before{
  content: "Browse";
}
.custom-file-control:after{
  content: "Add files..";
}

@L_301_2@

原文链接:https://www.f2er.com/html/226664.html

猜你在找的HTML相关文章