没有标签的Bootstrap make按钮与表单字段对齐

时间:2018-10-07 23:48:03

标签: bootstrap-4

我有一个带有标签的水平表单,我想在末尾添加一个与表单字段对齐而不是顶部对齐的按钮。我以为我可以用标签和不间断的空间来完成此操作,但是我没有运气。

enter image description here

一个表单域+按钮的代码:

        <div class="col-md-2">
            @Html.LabelFor(model => model.Bencap, htmlAttributes: new { @class = "control-label" })

            @Html.EditorFor(model => model.Bencap, new { htmlAttributes = new { @class = "form-control" } })
            @Html.ValidationMessageFor(model => model.Bencap, "", new { @class = "text-danger" })
        </div>
        <div class="col-md-1">
            <label class="control-label">&nbsp;</label>
            <button type="button" class="deleteRow btn btn-danger">X</button>
        </div>

0 个答案:

没有答案