Bulma | Level

Bulma is a free, open-source CSS framework based on Flexbox. It is component rich, compatible, and well documented. It is highly responsive in nature. It uses classes to implement its design.

The Level is a multi-purpose horizontal level, which can contain almost any other element. The level component includes several other components that we have to add exclusively to design our content well. These components are listed below.

  1. level: It is the main container
  2. level-left: It is the container for the left side contents.
  3. level-right: It is the container for the right side contents.
  4. level-items: Itis for each individual level items. In a level-item, you can then insert almost anything you want, a title, a button, a text input, or just simple text. No matter what elements you put inside a Bulma level, they will always be vertically centered.

Example 1: Simple level elements

filter_none

edit
close

play_arrow

link
brightness_4
code

<html>
  <head>
    <title>Bulma Level</title>
    <link rel='stylesheet' 
          href=
    <!-- custom css -->
    <style>
      div.adjust{
        margin-top:50px;
      }
  
    </style>
  </head>
  <body>  
    <div class='container adjust'>
      <nav class="level">
        <!-- Left side -->
        <div class="level-left">
          <div class="level-item">
            <button class='button is-primary'>
                  Left-1
            </button>
          </div>
          <div class="level-item">
            <div class="field has-addons">
              <button class='button is-primary'>
                 Left-2
              </button>
            </div>
          </div>
        </div>
        
        <!-- Right side -->
        <div class='level-right'>
          <div class="level-item">
            <div class="field has-addons">
              <button class='button is-success'>
                   Right-1
              </button>
            </div>
          </div>
          <div class="level-item">
            <div class="field has-addons">
              <button class='button is-success'>
                  Right-2</button>
            </div>
          </div>
          <div class="level-item">
            <div class="field has-addons">
              <button class='button is-success'>
                  Right-3</button>
            </div>
          </div>
          <div class="level-item">
            <div class="field has-addons">
              <button class='button is-success'>
                    Right-4</button>
            </div>
          </div>
        </div>
      </nav>
    </div>
  </body>
</html>

chevron_right


Output:

Example 2: Mobile Level elements



filter_none

edit
close

play_arrow

link
brightness_4
code

<html>
  <head>
    <title>Bulma Level</title>
    <link rel='stylesheet' 
          href=
    <!-- custom css -->
    <style>
      div.adjust{
        margin-top:50px;
      }
  
    </style>
  </head>
  <body>
    <div class='container adjust'>
      <nav class="level is-mobile">
        <div class="level-item has-text-centered">
          <div>
            <button class='button is-danger'>
                button-1</button>
          </div>
        </div>
        <div class="level-item has-text-centered">
          <div>
            <button class='button is-danger'>
                button-2</button>
          </div>
        </div>
        <div class="level-item has-text-centered">
          <div>
            <button class='button is-danger'>
                button-3</button>
          </div>
        </div>
        <div class="level-item has-text-centered">
          <div>
            <button class='button is-danger'>
                   button-4</button>
          </div>
        </div>
        <div class="level-item has-text-centered">
          <div>
            <button class='button is-danger'>
                     button-5</button>
          </div>
        </div>
      </nav>
    </div>
  </body>
</html>

chevron_right


Example 3: Centered Level elements

filter_none

edit
close

play_arrow

link
brightness_4
code

<html>
  <head>
    <title>Bulma Level</title>
    <link rel='stylesheet' 
          href=
    <!-- custom css -->
    <style>
      div.adjust{
        margin-top:50px;
      }
  
    </style>
  </head>
  <body>
    <div class='container adjust'>
      <nav class="level">
        <div class="level-item has-text-centered">
          <div>
            <button class='button is-danger'>
                  button-1</button>
          </div>
        </div>
        <div class="level-item has-text-centered">
          <div>
            <button class='button is-danger'>
                  button-2</button>
          </div>
        </div>
        <div class="level-item has-text-centered">
          <div>
            <button class='button is-danger'>
                 button-3</button>
          </div>
        </div>
        <div class="level-item has-text-centered">
          <div>
            <button class='button is-danger'>
                     button-4</button>
          </div>
        </div>
        <div class="level-item has-text-centered">
          <div>
            <button class='button is-danger'>
                     button-5</button>
          </div>
        </div>
      </nav>
    </div>
  </body>
</html>

chevron_right


Output

centered-level-elements(in big screen)


centered level elements(in small screen)




My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.