【问题标题】:Dropdown cut off in bootstrap 4下拉菜单在引导程序 4 中被切断
【发布时间】:2019-01-27 07:50:27
【问题描述】:

我在使用应用程序中的所有下拉菜单时遇到问题。我正在实施 Bootstrap 4,在以前的版本 v3 中,下拉菜单显示正确,但现在看起来像这样:

在 HTML 视图中下拉元素的使用非常简单:

<div class="card-body">
                    <div class="form-group row">
                        @Html.LabelFor(m => m.RequestLodgingID, new { @class = "col-md-4 control-label" })
                        <div class="col-md-8">
                            @Html.DropDownListFor(m => m.RequestLodgingID, Model.LodgingSelectList, new { Class = "form-control" })
                            @Html.ValidationMessageFor(m => m.RequestLodgingID)
                        </div>
                    </div>
                    <div class="form-group row">
                        @Html.LabelFor(m => m.RequestLodgingSizeID, new { @class = "col-md-4 control-label" })
                        <div class="col-md-8">
                            @Html.DropDownListFor(m => m.RequestLodgingSizeID, Model.LodgingSizeSelectList, new { Class = "form-control" })
                            @Html.ValidationMessageFor(m => m.RequestLodgingSizeID)
                        </div>
                    </div>
                </div>

我不知道这是怎么开始的,我到底错过了什么?

【问题讨论】:

  • 对于所有想知道的人,请查看下面,我找到了解决方案并将其发布在下面。

标签: html drop-down-menu bootstrap-4


【解决方案1】:

更新:通过添加'input-sm'类解决它:

@Html.DropDownListFor(m => m.RequestLodgingID, Model.LodgingSelectList, new { Class = "form-control input-sm" })

【讨论】:

    猜你喜欢
    • 2013-01-06
    • 2019-06-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-03-23
    相关资源
    最近更新 更多