Reputation: 21934
<div class="row">
<div class="span12">
<div class="btn-toolbar">
<!-- buttons go here -->
</div>
</div>
</div>
Is there a way to center my button toolbar without using offset?
I tried applying "margin: 0 auto;" to my toolbar div but this did not work.
Upvotes: 5
Views: 17070
Reputation: 3262
you can use inline css and it work for me.
<div class="btn-toolbar" style="justify-content: center; display: flex;" >
Thanks.
Upvotes: 6
Reputation: 221
Try add "center" attribute on row class on bootstrap 3. like
<div class="row center">
....
</div>
Upvotes: 0
Reputation: 5123
<div class="row">
<div class="span12">
<div class="btn-toolbar">
<div class="btn-group">
<button class="btn">1</button>
<button class="btn">2</button>
<button class="btn">3</button>
</div>
<div class="btn-group">
<button class="btn">1</button>
<button class="btn">2</button>
<button class="btn">3</button>
</div>
</div>
</div>
</div>
.btn-toolbar{
text-align: center;
}
Upvotes: 8