asp.net-mvc - Bootstrap 4 从右到左自定义文件输入
问题描述
我正在尝试使上传文件输入方向从引导程序 4 从右到左,但到目前为止我没有尝试过
我也尝试改变不同标签的方向
<div class="form-group">
<div class="col-md-4">
<div class="custom-file">
<input type="file" class="custom-file-input" id="customFile" multiple lang="ar" dir="rtl">
<label class="custom-file-label text-left" for="customFile">choose files to upload</label>
</div>
</div>
<script type="text/javascript">
$('.custom-file input').change(function (e) {
var files = [];
for (var i = 0; i < $(this)[0].files.length; i++) {
files.push($(this)[0].files[i].name);
}
$(this).next('.custom-file-label').html(files.join(', '));
});
</script>
</div>
解决方案
你需要一个像这样的自定义 CSS ......
.custom-file-label::after {
left: 0;
right: auto;
border-left-width: 0;
border-right: inherit;
}
推荐阅读
- asp.net-core - 如何读取字符串数据并仅从中获取数字并将其存储在列表中
- c - 重新排序双精度类型数据
- sql - 如何在 SWITCH 语句中设置范围?
- python - 用 Python 替换 JSON 文件中的字符。由于大文件(超过 1 GB)而导致编辑问题
- ios - NWConnection 发送多个数据报
- python - 比 iterrows 迭代 df 并设置另一个列值的更好方法
- javascript - react - 使用 for 循环创建 x 个组件实例
- javascript - 如何获得另一个属性等于 x 的属性值?
- laravel - 使用 SSH 将文件从远程服务器复制到本地服务器
- python - rabbitmq 是如何同步消息的?