首页 > 解决方案 > 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>

bootstrap 上传文件控制风格

标签: asp.net-mvcbootstrap-4right-to-left

解决方案


你需要一个像这样的自定义 CSS ......

.custom-file-label::after {
    left: 0;
    right: auto;
    border-left-width: 0;
    border-right: inherit;
}

演示:https ://www.codeply.com/go/kOURGBHqEX


推荐阅读