我的输入旁边有一个长标签,它没有垂直对齐。
有什么办法可以解决吗like it was in Bootstrap 2 ,请问?
<form class="form-horizontal" role="form">
<div class="form-group">
<label for="input1" class="col-lg-2 control-label">Labdas kjas kljas dlkjasd lksjd el1</label>
<div class="col-lg-10">
<input type="text" class="form-control" id="input1" placeholder="Input1">
</div>
</div>
<div class="form-group">
<label for="input2" class="col-lg-2 control-label">Label2</label>
<div class="col-lg-10">
<input type="password" class="form-control" id="input2" placeholder="Input2">
</div>
</div>
</form>
最佳答案
不是很干净...您需要向长标签添加覆盖类,例如 multiline
,然后像这样为该类添加定义
.control-label.multiline
{
padding-top:0;
}
关于html - 如何在 Bootstrap 3 中垂直对齐长标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22208851/