Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Twitter bootstrap: center button toolbar?

<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.

like image 879
redconservatory Avatar asked Aug 09 '12 14:08

redconservatory


2 Answers

http://jsfiddle.net/rx9Y2/

<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;
}​
like image 72
bvulaj Avatar answered Nov 03 '22 04:11

bvulaj


you can use inline css and it work for me.

<div class="btn-toolbar" style="justify-content: center; display: flex;" >

Thanks.

like image 37
Y. Joy Ch. Singha Avatar answered Nov 03 '22 03:11

Y. Joy Ch. Singha