Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Space between buttons with bootstrap class

I have a problem with three buttons on my site. I would like to have some space between those buttons. Is it possible to do this, without using inline styling? Perhaps bootstrap has some classes for this?

I know I can simply do it with:

style='margin-right:5px;'

or write custom class with this property.

I am just wondering if bootstrap has some classes for this?

Here is example.

Problem is with this three buttons:

<button type="button" class="btn btn-primary col-sm-1">1/2</button>
<button type="button" class="btn btn-primary col-sm-1">1/2</button>
<button type="button" class="btn btn-primary col-sm-1">1/2</button>
like image 270
FrenkyB Avatar asked Apr 30 '26 09:04

FrenkyB


1 Answers

Yes you have to wrap them

<div class="btn-group">
<button type="button" class="btn btn-primary">1/2</button>
</div>
<div class="btn-group">
<button type="button" class="btn btn-primary">1/2</button>
</div>
<div class="btn-group">
<button type="button" class="btn btn-primary">1/2</button>
</div>

EDITED CODEPEN

like image 163
Sandwell Avatar answered May 01 '26 22:05

Sandwell