daydreamer daydreamer - 1 year ago 137
CSS Question

How can I make space between two buttons in same div?

What is the best way to horizontally space Bootstrap buttons?

At the moment the buttons are touching:

<div class="btn-group">
<button class="btn btn-inverse dropdown-toggle" data-toggle="dropdown">
<i class="icon-in-button"></i>
Add to list
<span class="caret"/>
<ul class="dropdown-menu">
<a href="#">here</a>
<a href="#">new</a>
<button class="btn btn-info">
<i class="icon-in-button"></i>

Two Bootstrap buttons

jsfiddle showing the problem:

Answer Source

Put them inside btn-toolbar or some other container, not btn-group. btn-group joins them together. More info on Bootstrap documentation.

Edit: The original question was for Bootstrap 2.x, but the same is still valid for Bootstrap 3.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download