我有一个带有标签的水平表单,我想在末尾添加一个与表单字段对齐而不是顶部对齐的按钮。我以为我可以用标签和不间断的空间来完成此操作,但是我没有运气。
一个表单域+按钮的代码:
<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"> </label>
<button type="button" class="deleteRow btn btn-danger">X</button>
</div>