Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Issues
  • #16824
Closed
Open
Issue created Jul 14, 2015 by Administrator@rootContributor

.form-group-lg, .form-group-sm <label> has wrong line-height

Created by: adamhooper

The labels in the sample at http://getbootstrap.com/css/#horizontal-form-group-sizes don't line up vertically. (Neither do the labels I add to my app.)

For posterity's sake, I'll copy/paste the example HTML:

<form class="form-horizontal">
  <div class="form-group form-group-lg">
    <label class="col-sm-2 control-label" for="formGroupInputLarge">Large label</label>
    <div class="col-sm-10">
      <input class="form-control" type="text" id="formGroupInputLarge" placeholder="Large input">
    </div>
  </div>
  <div class="form-group form-group-sm">
    <label class="col-sm-2 control-label" for="formGroupInputSmall">Small label</label>
    <div class="col-sm-10">
      <input class="form-control" type="text" id="formGroupInputSmall" placeholder="Small input">
    </div>
  </div>
</form>

The label.col-sm-2.control-label inherits the body line-height, 1.42857143.

The input has line-height 1.5.

And sure enough, the label is a pixel higher than the input.

As for the form-group-lg: the error is much more pronounced. That's probably why the control-label has padding-top @padding-large-vertical * @line-height-large + 1, which randomly seems about correct. (Otherwise it would be simply @padding-large-vertical + 1, or it would have a comment.)

Fix:

  • .form-group-lg .control-label { line-height: @line-height-large; padding-top: (@padding-large-vertical + 1); }
  • .form-group-sm .control-label { line-height: @line-height-small; }

... I'm not 100% sure of myself here, hence the lack of pull request. But I'm pretty sure. Anyway, the example at http://getbootstrap.com/css/#horizontal-form-group-sizes is certainly misaligned.

Assignee
Assign to
Time tracking