我正在尝试使用 bootstrap4 alpha 6 实现自定义文件输入,但添加后出现空白部分,如下所示:
<label class="custom-file">
<input type="file" id="file" class="custom-file-input">
<span class="custom-file-control"></span>
</label>
Bootstrap4 file browser documentation
我应该为这个实现添加任何 CSS 样式吗?
最佳答案
如文档中所述,占位符和按钮在 CSS 中设置:
.custom-file-control::after {
content: "Select file...";
}
.custom-file-control::before {
content: "Click me";
}
http://www.codeply.com/go/jcnmleDWja
此外,您还可以在 HTML 文档中使用语言声明。例如,
<html lang="en"></html>
并为每种语言设置特定的样式...
.custom-file-control:lang(en)::after {
content: "Select file...";
}
.custom-file-control:lang(en)::before {
content: "Click me";
}
关于css - 使用 bootstrap4 输入空白自定义文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43422629/