redconservatory
redconservatory

Reputation: 21934

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.

Upvotes: 5

Views: 17070

Answers (3)

Y. Joy Ch. Singha
Y. Joy Ch. Singha

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

L.Guan
L.Guan

Reputation: 221

Try add "center" attribute on row class on bootstrap 3. like

<div class="row center"> .... </div>

Upvotes: 0

bvulaj
bvulaj

Reputation: 5123

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;
}​

Upvotes: 8

Related Questions