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

标签 html css twitter-bootstrap twitter-bootstrap-3

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

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

相关文章:

JavaScript 函数被忽略

javascript - 如何获取计算机屏幕上元素的像素坐标

html - 悬停背景图像消失在文本后面

javascript - 如何在没有弹出窗口的情况下打印数据它应该直接点击打印

css3 转换(旋转)在 Chromium 中无法正常工作

html - 将 Bootstrap 输入元素移到页面下方

javascript - ng-repeat with an if-statement in Angular

html - 2 列部分中的垂直对齐文本/按钮

ruby-on-rails - rails : Font Awesome doesnt download

html - 从 CSS 库(Bootstrap)覆盖 CSS