最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Horizontally centering items in Columns in Bulma Framework - Stack Overflow

programmeradmin0浏览0评论

I would like to center my content horizontally inside of the columns of Bulma.

Here's an example:

I would like to center those 'class="column is-2"' in the 'columns' div.

Here's how my code starts:

<div class="columns is-vcentered">
    <div class="column is-three-fifths is-offset-one-fifth has-text-centered">
        <div class="columns is-desktop is-vcentered">
            <div class="column is-2">
                    <button mat-raised-button color="primary" (click)="initTimer()">
                        <mat-icon>play_arrow</mat-icon>
                        Start Timer
                    </button>
            </div>

And I would like to center that is-2 with the button inside.

Any help would be appreciated. Thanks!

I would like to center my content horizontally inside of the columns of Bulma.

Here's an example:

http://prntscr.com/hooo8l

I would like to center those 'class="column is-2"' in the 'columns' div.

Here's how my code starts:

<div class="columns is-vcentered">
    <div class="column is-three-fifths is-offset-one-fifth has-text-centered">
        <div class="columns is-desktop is-vcentered">
            <div class="column is-2">
                    <button mat-raised-button color="primary" (click)="initTimer()">
                        <mat-icon>play_arrow</mat-icon>
                        Start Timer
                    </button>
            </div>

And I would like to center that is-2 with the button inside.

Any help would be appreciated. Thanks!

Share Improve this question asked Dec 17, 2017 at 16:02 filipbarakfilipbarak 1,9052 gold badges19 silver badges30 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 28

If you want to center align the buttons within their container and their container within the available space, this is what you want to do the following:

<div class="columns is-centered">
  <div class="column has-text-centered is-2">
    <a class="button">Button 1</a>
  </div>
  <div class="column has-text-centered is-2">
    <a class="button">Button 2</a>
  </div>
  <div class="column has-text-centered is-2">
    <a class="button">Button 3</a>
  </div>
  <div class="column has-text-centered is-2">
    <a class="button">Button 4</a>
  </div>
</div>

JS Fiddle example

Hope this is what you meant.

发布评论

评论列表(0)

  1. 暂无评论