Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/38.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何设计控件下拉列表和复选框,使它们彼此相邻MVC 5引导4_C#_Css_Asp.net Mvc_Bootstrap 4_Asp.net Mvc 5 - Fatal编程技术网

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>