gpt4 book ai didi

html - 如何在 Bootstrap 3 中垂直对齐长标签

转载 作者:太空狗 更新时间:2023-10-29 16:46:35 25 4
gpt4 key购买 nike

我的输入旁边有一个长标签,它没有垂直对齐。

有什么办法可以解决吗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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com