C# 如何设计控件下拉列表和复选框,使它们彼此相邻MVC 5引导4
现在的控件是这样的C# 如何设计控件下拉列表和复选框,使它们彼此相邻MVC 5引导4,c#,css,asp.net-mvc,bootstrap-4,asp.net-mvc-5,C#,Css,Asp.net Mvc,Bootstrap 4,Asp.net Mvc 5,现在的控件是这样的 <div class="form-horizontal"> <div class="form-group "> @Html.LabelFor(model => model.TribeId, @Resource.TribeName, htmlAttributes: new { @class = "control-label col-md-2" }) <div c
<div class="form-horizontal">
<div class="form-group ">
@Html.LabelFor(model => model.TribeId, @Resource.TribeName, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-4">
@Html.DropDownList("TribeId", null, @Resource.SelectTribe, htmlAttributes: new { @class = "form-control" })
@Html.ValidationMessageFor(model => model.TribeId, "", new { @class = "text-danger" })
</div>
<div class="col-lef-1">
<input type="checkbox" id="chkTribe" name="" value="">
<label>@Resource.Skip</label>
</div>
</div>
</div>
如图所示,
所有的下拉菜单都和标签一样,下拉菜单也可以,但我希望下拉菜单旁边的复选框靠近下拉菜单
希望你的梦想成真
谢谢你使用这个:
确保在父div中使用class row,这样子级将在col-12中的一行中。
如果您有复选框的位置问题,请使用padding top to checkbox div。
希望这是你想要的:
<div class='col-md-12 form-group row'>
<div class="col-md-12"><label for="test">LABEL</label></div>
<div class="col-md-3">
<select name="test" class='form-control'>
<option>1</option>
<option>2</option>
</select>
</div>
<div class="col-md-3">
<input type="checkbox" id="chkTribe" name="" value="">
<label>Checkbox</label>
</div>
</div>