Bulma: How do you center a button in a box?

Dazzle picture Dazzle · Mar 3, 2017 · Viewed 50k times · Source
<div class="box">
 <button class="button">Center me</button>
</div>

<button class="is-center"> is not working.

Answer

Mohammad Usman picture Mohammad Usman · Mar 6, 2017

Yes, there is a native way.

Bulma offers has-text-centered class for centering text, inline and inline-block elements.

You can use following code:

<div class="box has-text-centered">
  <button class="button">Center me</button>
</div>

Demo:

<link href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.3.2/css/bulma.css" rel="stylesheet"/>
<div class="box has-text-centered">
 <button class="button">Center me</button>
</div>