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
  • #3434
Closed
Open
Issue created May 10, 2012 by Administrator@rootContributor

.btn-group and .btn don't vertically align nicely together

Created by: fredrock

When a .btn (a, button, or input) are in the same container with a .btn-group, the vertical alignment is off.

I tested this in a simple case by modifying the example at the bottom of http://twitter.github.com/bootstrap/base-css.html

<div class="btn-toolbar">
  <a class="btn" href="#"><i class="icon-align-left"></i></a>
  <div class="btn-group">
    <a class="btn" href="#"><i class="icon-align-left"></i></a>
    <a class="btn" href="#"><i class="icon-align-center"></i></a>
    <a class="btn" href="#"><i class="icon-align-right"></i></a>
    <a class="btn" href="#"><i class="icon-align-justify"></i></a>
  </div>
  <div class="btn-group">
    <a class="btn btn-primary" href="#"><i class="icon-user icon-white"></i> User</a>
    <a class="btn btn-primary dropdown-toggle" data-toggle="dropdown" href="#"><span class="caret"></span></a>
    <ul class="dropdown-menu">
      <li><a href="#"><i class="icon-pencil"></i> Edit</a></li>
      <li><a href="#"><i class="icon-trash"></i> Delete</a></li>
      <li><a href="#"><i class="icon-ban-circle"></i> Ban</a></li>
      <li class="divider"></li>
      <li><a href="#"><i class="i"></i> Make admin</a></li>
    </ul>
  </div>
</div>

I have tested this in the latest releases of Chrome and Firefox, and experience the same issue.

What I'm going right now to hack-fix the issue is as follows:

.btn-group > .btn {
  float: none;
  margin-left: -5px;
}

But because that depends heavily on the font being used and differences in browsers, this is not really a viable solution

I'm in the midst of trying different things to try and fix this, and have not completely pinpointed the issue. It seems that the float on the .btn within the .btn-group is part of the problem.

If anyone has any ideas, I'd like to try them out.

Assignee
Assign to
Time tracking