【发布时间】:2018-02-01 01:46:30
【问题描述】:
我有一个如下所示的表单:
@using (Html.BeginForm())
{
@Html.AntiForgeryToken()
<div class="form-horizontal card card-body my-bg">
<div class="form-group row justify-content-center align-content-center">
<div class="col-md">
@Html.Label("My Label", new { @class = "control-label col-md-12" })
<div class="col-md-12">
@Html.TextBoxFor(model => model.TestName, null, new { @class = "form-control", @disabled = "disabled" })
</div>
</div>
<div class="col-md">
@Html.Label("Label Two", new { @class = "control-label col-md-12" })
<div class="col-md-12">
@Html.TextBoxFor(model => model.TestProperty, null, new { @class = "form-control", @disabled = "disabled" })
</div>
</div>
</div>
</div>
}
如您所见,我尝试了justify-content-center align-content-center,但它们并没有垂直居中我的表单。
如何使表单垂直居中?
【问题讨论】:
标签: html css twitter-bootstrap bootstrap-4