我在应用程序中的所有下拉菜单上遇到问题。我正在实施Bootstrap 4,在以前的版本v3中,下拉列表已正确显示,但现在看起来像这样:
HTML视图中dropdown元素的用法非常简单:
<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>
我不知道这是怎么开始的,我到底想念什么?
答案 0 :(得分:0)
更新:通过添加'input-sm'类来解决它:
@Html.DropDownListFor(m => m.RequestLodgingID, Model.LodgingSelectList, new { Class = "form-control input-sm" })