Bootstrap 5.2' form-loploating'班级问题/问题

发布于 2025-02-10 21:37:10 字数 2552 浏览 0 评论 0原文

我正在使用Bootstrap 5.2,并且有一个包含以下表单段的表单:

<div class="row mb-2 align-items-center">
                        <div class="col-sm-4">
                            <label class="checkbox-inline" for="Credit_Pulled">Credit Pulled</label>
                            <input type="checkbox" class="form-check-inline" value="1" name="Credit_Pulled" id="Credit_Pulled">
                        </div>
                        <div class="col-sm-4">
                            <label class="checkbox-inline" for="Is_On_Terms">Approved For Terms</label>
                            <input type="checkbox" class="align-middle" value="true" name="Is_On_Terms" id="Is_On_Terms">
                        </div>
                        <div class="col-sm-4 form-floating">
                            <label for="Terms_Days">Terms Period</label>
                            <select class="form-select form-control d-flex" id="Terms_Days" name="Terms_Days">
                                <option value="0" selected>NONE</option>
                                <option value="30">NET-30</option>
                                <option value="60">NET-60</option>
                                <option value="90">NET-90</option>
                            </select>
                        </div>
                    </div>
                    <div class="row mb-2">
                        <div class="col-sm-4 form-floating">
                            <label for="Credit_Limit">Approved Limit</label>
                            <input type="text" class="form-control d-flex" id="Credit_Limit" name="Credit_Limit">
                        </div>
                    </div>
                    <div class="row mb-2">
                        <div class="col-sm-12 w-100 form-floating">
                            <label for="Review_Notes">Review Notes</label>
                            <textarea class="form-control rounded" rows="8" id="Review_Notes" name="Review_Notes"></textarea>
                        </div>
                    </div>

当我查看表单时,这就是我得到的:

“来自代码上方的输出”

问题是,问题是表单标签及其内容重叠。有什么方法(即使添加自定义CSS)可以防止这种情况清洁显示?

I am using Bootstrap 5.2, and I have a form that includes the following form snippet:

<div class="row mb-2 align-items-center">
                        <div class="col-sm-4">
                            <label class="checkbox-inline" for="Credit_Pulled">Credit Pulled</label>
                            <input type="checkbox" class="form-check-inline" value="1" name="Credit_Pulled" id="Credit_Pulled">
                        </div>
                        <div class="col-sm-4">
                            <label class="checkbox-inline" for="Is_On_Terms">Approved For Terms</label>
                            <input type="checkbox" class="align-middle" value="true" name="Is_On_Terms" id="Is_On_Terms">
                        </div>
                        <div class="col-sm-4 form-floating">
                            <label for="Terms_Days">Terms Period</label>
                            <select class="form-select form-control d-flex" id="Terms_Days" name="Terms_Days">
                                <option value="0" selected>NONE</option>
                                <option value="30">NET-30</option>
                                <option value="60">NET-60</option>
                                <option value="90">NET-90</option>
                            </select>
                        </div>
                    </div>
                    <div class="row mb-2">
                        <div class="col-sm-4 form-floating">
                            <label for="Credit_Limit">Approved Limit</label>
                            <input type="text" class="form-control d-flex" id="Credit_Limit" name="Credit_Limit">
                        </div>
                    </div>
                    <div class="row mb-2">
                        <div class="col-sm-12 w-100 form-floating">
                            <label for="Review_Notes">Review Notes</label>
                            <textarea class="form-control rounded" rows="8" id="Review_Notes" name="Review_Notes"></textarea>
                        </div>
                    </div>

When I view the form, this is what I get:

Output from code above

The problem is, the form labels and their contents overlap. Is there any way (even by adding custom CSS) to prevent this so that they display cleanly?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

贱人配狗天长地久 2025-02-17 21:37:10

Bootstrap文档说&lt; label&gt;需要在&lt; input&gt; https://getbootstrap.com/docs/5.0/forms/floating-labels/

Bootstrap docs says that the <label> needs to come after the <input> https://getbootstrap.com/docs/5.0/forms/floating-labels/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文