【发布时间】:2015-06-11 06:33:00
【问题描述】:
我在一行中有两个表单控件,其他控件使用 Bootstrap v3.3.4 正确对齐
能否请您帮助我将顶部两个控件(下拉和文本框)与底部文本框对齐。 提前谢谢你
我尝试在此处使用 JSFiddle 复制对齐问题:https://jsfiddle.net/bswn9o8g/
也在此处发布图片:http://postimg.org/image/4iawvs0zn/ 这是HTML代码
<div class="form-horizontal">
<h4>SearchVM</h4>
<hr />
@Html.ValidationSummary(true, "", new { @class = "text-danger" })
<div class="form-group form-inline">
@Html.LabelFor(model => model.searchBy, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EnumDropDownListFor(model => model.searchBy, "Search By", htmlAttributes: new { @class = "form-control" })
@Html.TextBox("searchByVal", null, htmlAttributes: new { @placeholder = "SID / PID ", @class = "form-control" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.FirstName, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.FirstName, new { htmlAttributes = new { @placeholder = "First Name", @class = "form-control" } })
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.MiddleName, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.MiddleName, new { htmlAttributes = new { @placeholder = "Middle Name", @class = "form-control" } })
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.LastName, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.LastName, new { htmlAttributes = new { @placeholder = "Last Name", @class = "form-control" } })
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.DOB, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.DOB, new { htmlAttributes = new { @placeholder = "Birth Date", @class = "form-control" } })
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.CauseNumber, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.CauseNumber, new { htmlAttributes = new { @placeholder = "Cause#", @class = "form-control" } })
</div>
</div>
<div class="form-group">
<div class="col-md-offset-2 col-md-10">
<input type="submit" value="Create" class="btn btn-default" />
</div>
</div>
</div>
【问题讨论】:
-
能贴出生成的代码吗?
-
@Ted:你的意思是从 HTML 页面“查看源代码”吗?
-
您的问题的确切性质尚不清楚。请修改您的整体问题,以更好地解释您正在经历的确切行为是什么,以及预期的行为应该是什么。您也可能应该使用生成的代码来创建复制问题的 codepen 或 jsfiddle,并在您的问题中发布指向该问题的链接。这样我们就可以真正看到您所看到的。除此之外,也许添加一两个屏幕截图。
-
这里是 JSFiddle 链接:jsfiddle.net/bswn9o8g
标签: asp.net-mvc css twitter-bootstrap-3 alignment vertical-alignment