Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to center a section with bulma

Tags:

html

css

bulma

I am using bulma framework , and all the content is to the left, how would I center the content on the page? For example this image is to the left.

<section class="section">
  <div class="container">
    <div class="column">
      <figure>
        <img src="/assets/images/norris-lake.jpg" alt="Melton Hill Lake">
      </figure>
    </div>
  </div>
</section>
like image 583
user41758 Avatar asked Nov 10 '18 22:11

user41758


People also ask

How do I Center contents in a column 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.

How do you center a section of elements in CSS?

You can do this by setting the display property to "flex." Then define the align-items and justify-content property to “center.” This will tell the browser to center the flex item (the div within the div) vertically and horizontally.

How do you center the center of an element?

To center one box inside another we make the containing box a flex container. Then set align-items to center to perform centering on the block axis, and justify-content to center to perform centering on the inline axis.


1 Answers

Have a look at the Bulma docs for Centering columns

<link href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.2/css/bulma.css" rel="stylesheet" />
<section class="section">
  <div class="container">
    <div class="columns is-centered">
      <div class="column is-half">
        <figure>
          <img src="https://placeimg.com/640/480/any" alt="Melton Hill Lake">
        </figure>
      </div>
    </div>
  </div>
</section>
like image 56
ksav Avatar answered Sep 23 '22 03:09

ksav