Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bulma Grid Layout Columns Extend Over Viewport

Tags:

html

css

bulma

Using Bulma CSS framework.

I am trying to layout some elements and I am not sure why on a desktop view, the items once they go past the view port does not go to the next row.

Here's a sample code and corresponding link to a JS Bin:

 <!DOCTYPE html>
    <html>
    <head>
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width">
      <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.4.0/css/bulma.min.css">
      <title>JS Bin</title>
    </head>
    <body>
      <div class="columns">
        <div class="column is-one-quarter">
          Col 1
        </div>
        <div class="column is-one-quarter">
          Col 2
        </div>
        <div class="column is-one-quarter">
          Col 3
        </div>
        <div class="column is-one-quarter">
          Col 4
        </div>
        <div class="column is-one-quarter">
          Col 5
        </div>
      </div>
      <div class="columns">
        <div class="column is-4">
          column is-4
        </div>
        <div class="column is-4">
          column is-4
        </div>
        <div class="column is-4">
          column is-4
        </div>
        <div class="column is-4">
          column is-4
        </div>
        <div class="column is-4">
          column is-4
        </div>
      </div>
    </body>
    </html>

I've created a simple JS Bin to illustrate the problem.

http://jsbin.com/juquzexezu/edit?html,output

Notice that when you widen the output window, you would see that Col-5 div on the first row is not shown, as well as on the second row, the two remaining div elements are also not being displayed.

What I am looking for is to have those missing div elements automatically go to the next row when the horizontal view is already filled.

like image 663
Angelo Avatar asked Apr 23 '17 15:04

Angelo


People also ask

Is Bulma better than bootstrap?

Bulma provides a bit more flexibility for customization compared to Bootstrap. in addition, its modular structure provides more control over individual projects. Unlike Bootstrap, Bulma permits users to import only the modules required for desired features, omitting any that aren't necessary.

How do you give the width in Bulma?

If you want to change the maximum width of all containers, you can do so by updating the values of the $container-max-width Sass variable.

Is Flex direction column Mobile Bulma?

In Bulma, the flexbox properties are used as helpers. The flex-direction property allows the user to set the direction of items in a flex container with direction utilities, like row, row-reverse, column, column-reverse. Sometimes, the horizontal classes can be omitted as the default direction in the browser is row.

How do I center a column in Bulma?

You can make the columns centered by using .is-centered modifier on the columns container. Bulma also allows adding .is-multiline modifier to make multiple columns centered in a single row.


1 Answers

https://bulma.io/documentation/columns/options/#multiline

Use the class is-multiline on the columns div.

like image 130
Shafiq al-Shaar Avatar answered Sep 24 '22 07:09

Shafiq al-Shaar