DEV Community

Cover image for Bulma CSS Framework: Getting Started Guide
SatyamTripathi
SatyamTripathi

Posted on • Originally published at lambdatest.com

Bulma CSS Framework: Getting Started Guide

An interactive and responsive website provides a better user experience on all browsers, devices, and operating systems, engaging users and encouraging them to spend more time on the site.

According to a report by Forbes, usеrs judgе wеbsitеs within a mеrе 0.05 sеconds. This highlights the crucial role of impactful wеb dеsign. A wеll-dеsignеd, usеr-friеndly wеbsitе has thе powеr to captivatе visitors, rеtain thеir attеntion, and еvеn convеrt thеm into customеrs.

When users can access all of the website’s features on any device without any issues, such websites are more likely to rank higher in search results, which can increase traffic to the website. Key KPIs like average time spent on a page, bounce rate, sessions, conversion rate, etc., are all interconnected with the website experience. The better the web experience, the higher the time spent on the site, which might lead to increased conversions.

The web experience can be better if developers can import only what they need, developers can style the web pages without writing a single line of JavaScript code, and a lot more. This all can be done by using the Bulma CSS framework.

In this blog, we will dive deep into the Bulma CSS framework and explore how to use Bulma in your project. The learnings from this blog will further help you build a feature-rich website or mobile application with minimal effort.

Without further ado, let’s get started.

Looking for a tool to generate random text? Use our free online Random Character Generator to generate random characters for all your purposes. Try it out today.

What is Bulma CSS?

Bulma is a free, open-source, and lightweight CSS framework based on the CSS Flexbox layout. It provides CSS classes to help you style your HTML code, allowing developers to implement CSS on web pages more efficiently than plain CSS.

The main advantage of using Bulma CSS is that it is built on the Flexbox layout. This CSS layout model automatically adjusts the width of a page element to best fill the available space based on the width of its container without using many float and position properties in the CSS code.

Bulma is open-source, and the project is hosted on GitHub. It is compatible with recent versions of Chrome, Edge, Firefox, Opera, and Safari, but Internet Explorer (10+) is only partially supported. Bulma uses Autoprefixer to make Flexbox features compatible with earlier browser versions.

Shown below is the browser compatibility of the Bulma framework. This indicates that users can get a uniform web experience when it is opened across different browsers (and browser versions).

image

The below graph shows the distribution of organizations using Bulma. The computer software company is at the top, followed by IT and services. The hospital and healthcare industry use Bulma in very fewer numbers.

image

Tired of using old colors? Get your creative juices flowing with our free online random color generator. Try our tool to find fresh new hues.

Features of Bulma CSS Framework

Bulma CSS framework has a lot of features, such as responsiveness (elements can adjust to fit any viewport size). This framework is modular, which means you can import only what you need. You can style the webpage without writing a single line of JavaScript code. Also, the Bulma framework supports a massive library of interactive elements.

Responsiveness

Bulma CSS Framework is a mobile-first CSS framework that lets you build a responsive design for mobile, tablet, desktop, etc. Its built-in components are designed to be responsive, which means elements will move and adjust to fit any screen or viewport size.

The columns in Bulma are stacked on top of each other, and the navigation menu is hidden. The children of the level component are also stacked vertically.

Code:

<!DOCTYPE html>
<html>
  <head>
    <title>Platforms</title>
    <link
      rel="stylesheet"
      href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.9.3/css/bulma.min.css"
    />
  </head>
  <body>
    <!-- Header with logo and heading -->
    <header class="hero is-custom">
      <div class="hero-body">
        <div class="container">
          <div class="columns ">
            <div class="column is-one-quarter">
              <img
                src="https://user-images.githubusercontent.com/69134468/235296390-11fdb2a0-2909-4ac1-af00-7def636965e1.png"
                alt="Your logo"
                class="image is-64x64"
              />
            </div>
            <div class="column">
              <h1 class="title is-3">Platform</h1>
            </div>
          </div>
        </div>
      </div>
    </header>


    <!-- Pricing plans -->
    <section class="section">
      <div class="container">
        <div class="columns is-centered">
          <div class="column is-one-third">
            <div class="card has-background-primary-dark">
              <div class="card-content has-text-white">
                <div class="content">
                  <h4 class="title is-4 has-text-white">Playwright Testing</h4>
                  <p class="subtitle is-5 has-text-white">View Documentation</p>
                  <p>Run Playwright scripts on cloud-based infrastructure.</p>
                </div>
              </div>
            </div>
          </div>


          <div class="column is-one-third">
            <div class="card has-background-info-dark">
              <div class="card-content has-text-white">
                <div class="content">
                  <h4 class="title is-4 has-text-white">Selenium Testing</h4>
                  <p class="subtitle is-5 has-text-white">View Documentation</p>
                  <p>Run Selenium scripts on cloud-based infrastructure.</p>
                </div>
              </div>
            </div>
          </div>


          <div class="column is-one-third">
            <div class="card has-background-danger-dark">
              <div class="card-content has-text-white">
                <div class="content">
                  <h4 class="title is-4 has-text-white">Cypress Testing</h4>
                  <p class="subtitle is-5 has-text-white">View Documentation</p>
                  <p>Run Cypress scripts on cloud-based infrastructure.</p>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </section>
  </body>
</html>
Enter fullscreen mode Exit fullscreen mode

Output:

In the image below, columns are stacked on top of each other.

image

Columns are adjusted according to the change in the device, as shown below.

image

The above output has been rendered on LT Browser 2.0, a complimentary tool by the LambdaTest platform.

Need random dates? Our online Random Date Generator tool generates random dates for your projects. Choose a start and end date, and let our tool do the rest.

LT Browsеr 2.0 is a dеv-friеndly browsеr dеsignеd spеcifically for building, tеsting, and dеbugging mobilе wеbsitеs. It lеts you tеst wеbsitе pеrformancе on various mobilе dеvicе viеwports. Morеovеr, you can еvеn customizе thе viewport rеsolution to tеst your wеbsitеs, saving thеsе sеttings for futurе rеfеrеncе.

With LT Browsеr 2.0, you can еxplorе and assеss your wеbsitеs on a widе rangе of scrееn rеsolutions, including dеsktops, mobilеs, tablеts, and laptops. To get started, check our documentation on LT Browser 2.0

Subscribe to the LambdaTest YouTube Channel and stay up to date with the latest tutorials around Selenium testing, Cypress testing, and more.

<!DOCTYPE html>
<html>
  <head>
    <title>Platforms</title>
    <link
      rel="stylesheet"
      href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.9.3/css/bulma.min.css"
    />
  </head>
  <body>
    <!-- Header with logo and heading -->
    <header class="hero is-custom">
      <div class="hero-body">
        <div class="container">
          <div class="columns ">
            <div class="column is-one-quarter">
              <img
                src="https://user-images.githubusercontent.com/69134468/235296390-11fdb2a0-2909-4ac1-af00-7def636965e1.png"
                alt="Your logo"
                class="image is-64x64"
              />
            </div>
            <div class="column">
              <h1 class="title is-3">Platform</h1>
            </div>
          </div>
        </div>
      </div>
    </header>

    <!-- Pricing plans -->
    <section class="section">
      <div class="container">
        <div class="columns is-centered">
          <div class="column is-one-third">
            <div class="card has-background-primary-dark">
              <div class="card-content has-text-white">
                <div class="content">
                  <h4 class="title is-4 has-text-white">Playwright Testing</h4>
                  <p class="subtitle is-5 has-text-white">View Documentation</p>
                  <p>Run Playwright scripts on cloud-based infrastructure.</p>
                </div>
              </div>
            </div>
          </div>

          <div class="column is-one-third">
            <div class="card has-background-info-dark">
              <div class="card-content has-text-white">
                <div class="content">
                  <h4 class="title is-4 has-text-white">Selenium Testing</h4>
                  <p class="subtitle is-5 has-text-white">View Documentation</p>
                  <p>Run Selenium scripts on cloud-based infrastructure.</p>
                </div>
              </div>
            </div>
          </div>

          <div class="column is-one-third">
            <div class="card has-background-danger-dark">
              <div class="card-content has-text-white">
                <div class="content">
                  <h4 class="title is-4 has-text-white">Cypress Testing</h4>
                  <p class="subtitle is-5 has-text-white">View Documentation</p>
                  <p>Run Cypress scripts on cloud-based infrastructure.</p>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </section>
  </body>
</html>
Enter fullscreen mode Exit fullscreen mode

Above, we have seen that as the viewport size changes, the arrangement of columns has also changed, for the mobile device viewports, the columns were stacked on top of each other, but for the desktop, the columns became horizontal.

To achiеvе a horizontal layout for columns or lеvеl componеnts that works consistently across all viеwport sizеs, you can utilizе thе is-mobilе modifiеr.

<div class="columns is-centered is-mobile">
Enter fullscreen mode Exit fullscreen mode

As shown in the image below, the horizontal layout is the same across all the viewport sizes. This happens because we use the is-mobile modifier. The is-mobile modifier can be used to make the website looks good and easy to use on mobile device viewports.

Before *is-mobile:*

The columns are stacked on top of each other when we are not using the is-mobile modifier.

image

After *is-mobile:*

image

<!DOCTYPE html>
<html>
  <head>
    <title>Platforms</title>
    <link
      rel="stylesheet"
      href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.9.3/css/bulma.min.css"
    />
  </head>
  <body>
    <!-- Header with logo and heading -->
    <header class="hero is-custom">
      <div class="hero-body">
        <div class="container">
          <div class="columns ">
            <div class="column is-one-quarter">
              <img
                src="https://user-images.githubusercontent.com/69134468/235296390-11fdb2a0-2909-4ac1-af00-7def636965e1.png"
                alt="Your logo"
                class="image is-64x64"
              />
            </div>
            <div class="column">
              <h1 class="title is-3">Platform</h1>
            </div>
          </div>
        </div>
      </div>
    </header>

    <!-- Pricing plans -->
    <section class="section">
      <div class="container">
        <div class="columns is-centered is-mobile">
          <div class="column is-one-third">
            <div class="card has-background-primary-dark">
              <div class="card-content has-text-white">
                <div class="content">
                  <h4 class="title is-4 has-text-white">Playwright Testing</h4>
                  <p class="subtitle is-5 has-text-white">View Documentation</p>
                  <p>Run Playwright scripts on cloud-based infrastructure.</p>
                </div>
              </div>
            </div>
          </div>

          <div class="column is-one-third">
            <div class="card has-background-info-dark">
              <div class="card-content has-text-white">
                <div class="content">
                  <h4 class="title is-4 has-text-white">Selenium Testing</h4>
                  <p class="subtitle is-5 has-text-white">View Documentation</p>
                  <p>Run Selenium scripts on cloud-based infrastructure.</p>
                </div>
              </div>
            </div>
          </div>

          <div class="column is-one-third">
            <div class="card has-background-danger-dark">
              <div class="card-content has-text-white">
                <div class="content">
                  <h4 class="title is-4 has-text-white">Cypress Testing</h4>
                  <p class="subtitle is-5 has-text-white">View Documentation</p>
                  <p>Run Cypress scripts on cloud-based infrastructure.</p>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </section>
  </body>
</html>
Enter fullscreen mode Exit fullscreen mode

Modularity

Bulma CSS framework is fully modular, where you can import only what you need. Bulma consists of 39 .sass files that you can import individually. These files are located in the bulma/sass/grid folder.

Some of the .saas files are:

FILE NAME DESCRIPTION
button.sass To import the button style
card.sass To import the card style
checkbox.sass To import the checkbox
columns.sass To import the columns
container.sass To import the containers

When you import the specific file needed for your project, the amount of code will be reduced in the CSS file. This will enable the web page to load faster, improving both load times and render time. So, if the web page loads faster, this will enhance the user experience, and the chances of conversion will be increased.

For example, if you only want to use the button styles in your project, you can import the button styles directly from the Bulma framework by adding the following line to your own Sass or SCSS file.

@import "bulma/sass/utilities/_all.sass"
@import "bulma/sass/elements/button.sass"
Enter fullscreen mode Exit fullscreen mode
<!DOCTYPE html>
<html>
  <head>
    <title>My Basic Pricing Page</title>
    <link
      rel="stylesheet"
      href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.9.3/css/bulma.min.css"
    />
  </head>
  <body>
    <!-- Header with logo and heading -->
    <header class="hero is-custom">
      <div class="hero-body">
        <div class="container">
          <div class="columns">
            <div class="column is-one-quarter">
              <img
                src="https://user-images.githubusercontent.com/69134468/235296390-11fdb2a0-2909-4ac1-af00-7def636965e1.png"
                alt="Your logo"
                class="image is-64x64"
              />
            </div>
            <div class="column">
              <h1 class="title is-3">Pricing</h1>
            </div>
          </div>
        </div>
      </div>
    </header>

    <!-- Pricing plans -->
    <section class="section">
      <div class="container">
        <div class="columns is-centered">
          <div class="column is-one-third">
            <div class="card">
              <div class="card-content">
                <div class="content">
                  <h4 class="title is-4">Basic</h4>
                  <p class="subtitle is-5">$10/month</p>
                  <p>Basic Features Only</p>
                  <a href="#" class="button">Sign Up</a>
                </div>
              </div>
            </div>
          </div>

          <div class="column is-one-third">
            <div class="card">
              <div class="card-content">
                <div class="content">
                  <h4 class="title is-4">Standard</h4>
                  <p class="subtitle is-5">$20/month</p>
                  <p>Basic & Advanced Features</p>
                  <a href="#" class="button">Sign Up</a>
                </div>
              </div>
            </div>
          </div>

          <div class="column is-one-third">
            <div class="card">
              <div class="card-content">
                <div class="content">
                  <h4 class="title is-4">Premium</h4>
                  <p class="subtitle is-5">$30/month</p>
                  <p>All Premium Features</p>
                  <a href="#" class="button">Sign Up</a>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </section>
  </body>
</html>
Enter fullscreen mode Exit fullscreen mode

Need decimal fractions for your project or testing? Use our free and fast online Random Fraction Generator to generate random decimal fractions in seconds.

No JavaScript

You can use Bulma to style your web pages without writing a single line of JavaScript code. This makes Bulma a lightweight and easy-to-use CSS framework, especially for developers who prefer to focus more on styling than complex scripting.

Code:

<!DOCTYPE html>
<html>
  <head>
    <title>Platforms</title>
    <link
      rel="stylesheet"
      href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.9.3/css/bulma.min.css"
    />
  </head>
  <body>
    <!-- Header with logo and heading -->
    <header class="hero is-custom">
      <div class="hero-body">
        <div class="container">
          <div class="columns">
            <div class="column is-one-quarter">
              <img
                src="https://user-images.githubusercontent.com/69134468/235296390-11fdb2a0-2909-4ac1-af00-7def636965e1.png"
                alt="Your logo"
                class="image is-64x64"
              />
            </div>
            <div class="column">
              <h1 class="title is-3">Platform</h1>
            </div>
          </div>
        </div>
      </div>
    </header>


    <section class="section">
      <div class="container">
        <div class="columns is-centered">
          <div class="column is-one-third">
            <div class="card">
              <div class="card-content">
                <div class="content">
                  <h4 class="title is-4">Playwright Testing</h4>
                  <p class="subtitle is-5">View Documentation</p>
                  <p>Run Playwright scripts on cloud-based infrastructure.</p>
                </div>
              </div>
            </div>
          </div>


          <div class="column is-one-third">
            <div class="card">
              <div class="card-content">
                <div class="content">
                  <h4 class="title is-4">Selenium Testing</h4>
                  <p class="subtitle is-5">View Documentation</p>
                  <p>Run Selenium scripts on cloud-based infrastructure.</p>
                </div>
              </div>
            </div>
          </div>


          <div class="column is-one-third">
            <div class="card">
              <div class="card-content">
                <div class="content">
                  <h4 class="title is-4">Cypress Testing</h4>
                  <p class="subtitle is-5">View Documentation</p>
                  <p>Run Cypress scripts on cloud-based infrastructure.</p>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </section>
  </body>
</html>
Enter fullscreen mode Exit fullscreen mode

Output:

image

As shown below, the layout is fully responsive and adapts to different screen sizes without requiring any JavaScript code.

<!DOCTYPE html>
<html>
  <head>
    <title>Platforms</title>
    <link
      rel="stylesheet"
      href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.9.3/css/bulma.min.css"
    />
  </head>
  <body>
    <!-- Header with logo and heading -->
    <header class="hero is-custom">
      <div class="hero-body">
        <div class="container">
          <div class="columns">
            <div class="column is-one-quarter">
              <img
                src="https://user-images.githubusercontent.com/69134468/235296390-11fdb2a0-2909-4ac1-af00-7def636965e1.png"
                alt="Your logo"
                class="image is-64x64"
              />
            </div>
            <div class="column">
              <h1 class="title is-3">Platform</h1>
            </div>
          </div>
        </div>
      </div>
    </header>

    <!-- Pricing plans -->
    <section class="section">
      <div class="container">
        <div class="columns is-centered">
          <div class="column is-one-third">
            <div class="card">
              <div class="card-content">
                <div class="content">
                  <h4 class="title is-4">Playwright Testing</h4>
                  <p class="subtitle is-5">View Documentation</p>
                  <p>Run Playwright scripts on cloud-based infrastructure.</p>
                </div>
              </div>
            </div>
          </div>

          <div class="column is-one-third">
            <div class="card">
              <div class="card-content">
                <div class="content">
                  <h4 class="title is-4">Selenium Testing</h4>
                  <p class="subtitle is-5">View Documentation</p>
                  <p>Run Selenium scripts on cloud-based infrastructure.</p>
                </div>
              </div>
            </div>
          </div>

          <div class="column is-one-third">
            <div class="card">
              <div class="card-content">
                <div class="content">
                  <h4 class="title is-4">Cypress Testing</h4>
                  <p class="subtitle is-5">View Documentation</p>
                  <p>Run Cypress scripts on cloud-based infrastructure.</p>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </section>
  </body>
</html>
Enter fullscreen mode Exit fullscreen mode

Massive Library of Interactive Elements

Bulma provides many customizable components to create and customize website layouts and styles quickly. You don’t have to write complex CSS from scratch; instead, you can use predefined classes and components to achieve the desired look and functionality.

Bulma also provides helper classes to create more complex layouts and styles. For example, let’s say you have a div element in your HTML file and want to apply custom styling. You can use the helper classes to modify the margin, padding, background color, etc., of the div element.

Helper classes in Bulma CSS provide convenient options to style elements without having to write custom CSS rules. Below are some helper classes we are using:

HELPER CLASSES DESCRIPTION
has-text-centered Center text inside the div in the horizontal direction.
has-background-info Set the background color of the div to a light green color.
p-5 Add a padding of size 5 to all sides of the div.
m-5 Add a margin of size 5 to all sides of the div.
title is-4 Title of heading 4.
subtitle-is-5 Subtitle of heading 5.

Code:

<div class="column is-one-third">
  <div class="card has-text-centered has-background-primary m-5 p-3">
    <div class="card-content">
      <div class="content">
        <h4 class="title is-4">Playwright Testing</h4>
        <p class="subtitle is-5">View Documentation</p>
        <p>Run Playwright scripts on cloud-based infrastructure.</p>
      </div>
    </div>
  </div>
</div>
Enter fullscreen mode Exit fullscreen mode

Need accurate decimal values? Look no further! Our generator can create random decimals with just a few clicks. Try it out now and see for yourself.

Getting Started with Bulma CSS

To use Bulma in your project, you must first set it up. Setting up Bulma is super easy. You can do a setup in several ways. You can use a CDN, install the NPM package, download the GitHub release, and clone the GitHub repository.

To use a CDN, you can directly import it using the below code block. Include the code block below in the HTML file’s < head > element.

<link
      rel="stylesheet"
      href="https://cdn.jsdelivr.net/npm/bulma@0.9.3/css/bulma.min.css"
    />
Enter fullscreen mode Exit fullscreen mode

Code:

<!DOCTYPE html>
<html>
  <head>
    <title>Bulma CSS</title>


    <!--Bulma CDN-->
    <link
      rel="stylesheet"
      href="https://cdn.jsdelivr.net/npm/bulma@0.9.3/css/bulma.min.css"
    />
  </head>
  <body>
    <div class="container">
      <h1 class="title">Welcome to Bulma CSS</h1>
    </div>
  </body>
</html>
Enter fullscreen mode Exit fullscreen mode

To install the NPM package, run the below command in your terminal.


npm install bulma
Enter fullscreen mode Exit fullscreen mode

Now download the GitHub release of Bulma.

To clone the Bulma GitHub Repository, run the below command in your terminal, and then include the “bulma/css/bulma.css” in the code.

git clone https://github.com/jgthms/bulma.git
Enter fullscreen mode Exit fullscreen mode

Exploring Bulma’s Components and Layouts

Bulma uses HTML classes to style elements on a web page. It relies heavily on class-based syntax to simplify the process of applying styles to HTML elements. To style an element on a web page, simply add one or more classes inside the element’s HTML tag.

Let’s take a look at some examples.

Buttons

To create a button using Bulma, simply add the “button” class to your HTML button element like this:

<button class="button">Click me!</button>
Enter fullscreen mode Exit fullscreen mode

By adding the button class in the HTML element, Bulma recognizes the button class and applies some basic styling.


<a href="#" class="button">Sign Up</a>
Enter fullscreen mode Exit fullscreen mode
<!DOCTYPE html>
<html>
  <head>
    <title>My Basic Pricing Page</title>
    <link
      rel="stylesheet"
      href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.9.3/css/bulma.min.css"
    />
  </head>
  <body>
    <!-- Header with logo and heading -->
    <header class="hero is-custom">
      <div class="hero-body">
        <div class="container">
          <div class="columns">
            <div class="column is-one-quarter">
              <img
                src="https://user-images.githubusercontent.com/69134468/235296390-11fdb2a0-2909-4ac1-af00-7def636965e1.png"
                alt="Your logo"
                class="image is-64x64"
              />
            </div>
            <div class="column">
              <h1 class="title is-3">Pricing</h1>
            </div>
          </div>
        </div>
      </div>
    </header>

    <section class="section">
      <div class="container">
        <div class="columns is-centered">
          <div class="column is-one-third">
            <div class="card">
              <div class="card-content">
                <div class="content">
                  <h4 class="title is-4">Basic</h4>
                  <p class="subtitle is-5">$10/month</p>
                  <p>Basic Features Only</p>
                  <a href="#" class="button">Sign Up</a>
                </div>
              </div>
            </div>
          </div>

          <div class="column is-one-third">
            <div class="card">
              <div class="card-content">
                <div class="content">
                  <h4 class="title is-4">Standard</h4>
                  <p class="subtitle is-5">$20/month</p>
                  <p>Basic & Advanced Features</p>
                  <a href="#" class="button">Sign Up</a>
                </div>
              </div>
            </div>
          </div>

          <div class="column is-one-third">
            <div class="card">
              <div class="card-content">
                <div class="content">
                  <h4 class="title is-4">Premium</h4>
                  <p class="subtitle is-5">$30/month</p>
                  <p>All Premium Features</p>
                  <a href="#" class="button">Sign Up</a>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </section>
  </body>
</html>
Enter fullscreen mode Exit fullscreen mode

To enhance the style of your button, you can use Bulma modifiers. Bulma provides modifier classes that apply alternative styles to elements. The modifier class name starts with ‘is-‘ or ‘has-‘ followed by a style name.

For example, let’s take a look at the is-rounded modifier. This modifier gives your button a rounded appearance at the corners.

<a href="#" class="button is-rounded">Sign Up</a>
Enter fullscreen mode Exit fullscreen mode
<!DOCTYPE html>
<html>
  <head>
    <title>My Basic Pricing Page</title>
    <link
      rel="stylesheet"
      href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.9.3/css/bulma.min.css"
    />
  </head>
  <body>
    <!-- Header with logo and heading -->
    <header class="hero is-custom">
      <div class="hero-body">
        <div class="container">
          <div class="columns">
            <div class="column is-one-quarter">
              <img
                src="https://user-images.githubusercontent.com/69134468/235296390-11fdb2a0-2909-4ac1-af00-7def636965e1.png"
                alt="Your logo"
                class="image is-64x64"
              />
            </div>
            <div class="column">
              <h1 class="title is-3">Pricing</h1>
            </div>
          </div>
        </div>
      </div>
    </header>

    <!-- Pricing plans -->
    <section class="section">
      <div class="container">
        <div class="columns is-centered">
          <div class="column is-one-third">
            <div class="card">
              <div class="card-content">
                <div class="content">
                  <h4 class="title is-4">Basic</h4>
                  <p class="subtitle is-5">$10/month</p>
                  <p>Basic Features Only</p>
                  <a href="#" class="button is-rounded">Sign Up</a>
                </div>
              </div>
            </div>
          </div>

          <div class="column is-one-third">
            <div class="card">
              <div class="card-content">
                <div class="content">
                  <h4 class="title is-4">Standard</h4>
                  <p class="subtitle is-5">$20/month</p>
                  <p>Basic & Advanced Features</p>
                  <a href="#" class="button is-rounded">Sign Up</a>
                </div>
              </div>
            </div>
          </div>

          <div class="column is-one-third">
            <div class="card">
              <div class="card-content">
                <div class="content">
                  <h4 class="title is-4">Premium</h4>
                  <p class="subtitle is-5">$30/month</p>
                  <p>All Premium Features</p>
                  <a href="#" class="button is-rounded">Sign Up</a>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </section>
  </body>
</html>
Enter fullscreen mode Exit fullscreen mode

Modifiers can be used to adjust the colors and shading of your button. For example, ‘is-success’ will give your button a green appearance, ‘is-warning’ will give it a light yellow look, ‘is-danger’ will give it a red appearance, etc.

<a href="#" class="button is-rounded is-danger">Sign Up</a>
<a href="#" class="button is-rounded is-warning">Sign Up</a>
<a href="#" class="button is-rounded is-success">Sign Up</a>
Enter fullscreen mode Exit fullscreen mode
<!DOCTYPE html>
<html>
  <head>
    <title>My Basic Pricing Page</title>
    <link
      rel="stylesheet"
      href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.9.3/css/bulma.min.css"
    />
  </head>
  <body>
    <!-- Header with logo and heading -->
    <header class="hero is-custom">
      <div class="hero-body">
        <div class="container">
          <div class="columns">
            <div class="column is-one-quarter">
              <img
                src="https://user-images.githubusercontent.com/69134468/235296390-11fdb2a0-2909-4ac1-af00-7def636965e1.png"
                alt="Your logo"
                class="image is-64x64"
              />
            </div>
            <div class="column">
              <h1 class="title is-3">Pricing</h1>
            </div>
          </div>
        </div>
      </div>
    </header>

    <!-- Pricing plans -->
    <section class="section">
      <div class="container">
        <div class="columns is-centered">
          <div class="column is-one-third">
            <div class="card">
              <div class="card-content">
                <div class="content">
                  <h4 class="title is-4">Basic</h4>
                  <p class="subtitle is-5">$10/month</p>
                  <p>Basic Features Only</p>
                  <a href="#" class="button is-rounded is-danger">Sign Up</a>
                </div>
              </div>
            </div>
          </div>

          <div class="column is-one-third">
            <div class="card">
              <div class="card-content">
                <div class="content">
                  <h4 class="title is-4">Standard</h4>
                  <p class="subtitle is-5">$20/month</p>
                  <p>Basic & Advanced Features</p>
                  <a href="#" class="button is-rounded is-warning">Sign Up</a>
                </div>
              </div>
            </div>
          </div>

          <div class="column is-one-third">
            <div class="card">
              <div class="card-content">
                <div class="content">
                  <h4 class="title is-4">Premium</h4>
                  <p class="subtitle is-5">$30/month</p>
                  <p>All Premium Features</p>
                  <a href="#" class="button is-rounded is-success">Sign Up</a>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </section>
  </body>
</html>
Enter fullscreen mode Exit fullscreen mode

Multiple modifier classes can be applied to the same element. For example, you can use the ‘is-outlined’ modifier to apply an outlined style to an element. The ‘is-outlined’ class removes the background color of the button and replaces it with an outline.

<a href="#" class="button is-rounded is-danger is-outlined">Sign Up</a>
<a href="#" class="button is-rounded is-warning is-outlined">Sign Up</a>
<a href="#" class="button is-rounded is-success is-outlined">Sign Up</a>
Enter fullscreen mode Exit fullscreen mode
<!DOCTYPE html>
<html>
  <head>
    <title>My Basic Pricing Page</title>
    <link
      rel="stylesheet"
      href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.9.3/css/bulma.min.css"
    />
  </head>
  <body>
    <!-- Header with logo and heading -->
    <header class="hero is-custom">
      <div class="hero-body">
        <div class="container">
          <div class="columns">
            <div class="column is-one-quarter">
              <img
                src="https://user-images.githubusercontent.com/69134468/235296390-11fdb2a0-2909-4ac1-af00-7def636965e1.png"
                alt="Your logo"
                class="image is-64x64"
              />
            </div>
            <div class="column">
              <h1 class="title is-3">Pricing</h1>
            </div>
          </div>
        </div>
      </div>
    </header>

    <!-- Pricing plans -->
    <section class="section">
      <div class="container">
        <div class="columns is-centered">
          <div class="column is-one-third">
            <div class="card">
              <div class="card-content">
                <div class="content">
                  <h4 class="title is-4">Basic</h4>
                  <p class="subtitle is-5">$10/month</p>
                  <p>Basic Features Only</p>
                  <a href="#" class="button is-rounded is-danger is-outlined">Sign Up</a>
                </div>
              </div>
            </div>
          </div>

          <div class="column is-one-third">
            <div class="card">
              <div class="card-content">
                <div class="content">
                  <h4 class="title is-4">Standard</h4>
                  <p class="subtitle is-5">$20/month</p>
                  <p>Basic & Advanced Features</p>
                  <a href="#" class="button is-rounded is-warning is-outlined">Sign Up</a>
                </div>
              </div>
            </div>
          </div>

          <div class="column is-one-third">
            <div class="card">
              <div class="card-content">
                <div class="content">
                  <h4 class="title is-4">Premium</h4>
                  <p class="subtitle is-5">$30/month</p>
                  <p>All Premium Features</p>
                  <a href="#" class="button is-rounded is-success is-outlined">Sign Up</a>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </section>
  </body>
</html>
Enter fullscreen mode Exit fullscreen mode

To change the text color of your button, you can use the ‘has’ modifier. For example, the ‘has-text-success’ modifier will make the text look green, ‘has-text-grey’ will make the text gray, and so on.

<a href="#" class="button has-text-danger">Sign Up</a>
<a href="#" class="button has-text-warning">Sign Up</a>
<a href="#" class="button has-text-success">Sign Up</a>
Enter fullscreen mode Exit fullscreen mode
<!DOCTYPE html>
<html>
  <head>
    <title>My Basic Pricing Page</title>
    <link
      rel="stylesheet"
      href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.9.3/css/bulma.min.css"
    />
  </head>
  <body>
    <!-- Header with logo and heading -->
    <header class="hero is-custom">
      <div class="hero-body">
        <div class="container">
          <div class="columns">
            <div class="column is-one-quarter">
              <img
                src="https://user-images.githubusercontent.com/69134468/235296390-11fdb2a0-2909-4ac1-af00-7def636965e1.png"
                alt="Your logo"
                class="image is-64x64"
              />
            </div>
            <div class="column">
              <h1 class="title is-3">Pricing</h1>
            </div>
          </div>
        </div>
      </div>
    </header>

    <!-- Pricing plans -->
    <section class="section">
      <div class="container">
        <div class="columns is-centered">
          <div class="column is-one-third">
            <div class="card">
              <div class="card-content">
                <div class="content">
                  <h4 class="title is-4">Basic</h4>
                  <p class="subtitle is-5">$10/month</p>
                  <p>Basic Features Only</p>
                  <a href="#" class="button has-text-danger">Sign Up</a>
                </div>
              </div>
            </div>
          </div>

          <div class="column is-one-third">
            <div class="card">
              <div class="card-content">
                <div class="content">
                  <h4 class="title is-4">Standard</h4>
                  <p class="subtitle is-5">$20/month</p>
                  <p>Basic & Advanced Features</p>
                  <a href="#" class="button has-text-warning">Sign Up</a>
                </div>
              </div>
            </div>
          </div>

          <div class="column is-one-third">
            <div class="card">
              <div class="card-content">
                <div class="content">
                  <h4 class="title is-4">Premium</h4>
                  <p class="subtitle is-5">$30/month</p>
                  <p>All Premium Features</p>
                  <a href="#" class="button has-text-success">Sign Up</a>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </section>
  </body>
</html>
Enter fullscreen mode Exit fullscreen mode

Need a global unique identifier? Generate random GUIDs quickly and easily with our free online Random GUID Generator tool in seconds. Get a new GUID every time.

To change the button’s background color, you can use the ‘has’ modifier. For example, ‘has-background-white’ will make the background white, ‘has-background-success’ will make the background green, and so on.

<a href="#" class="button has-background-danger">Sign Up</a>
<a href="#" class="button has-background-warning">Sign Up</a>
<a href="#" class="button has-background-success">Sign Up</a>
Enter fullscreen mode Exit fullscreen mode
<!DOCTYPE html>
<html>
  <head>
    <title>My Basic Pricing Page</title>
    <link
      rel="stylesheet"
      href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.9.3/css/bulma.min.css"
    />
  </head>
  <body>
    <!-- Header with logo and heading -->
    <header class="hero is-custom">
      <div class="hero-body">
        <div class="container">
          <div class="columns">
            <div class="column is-one-quarter">
              <img
                src="https://user-images.githubusercontent.com/69134468/235296390-11fdb2a0-2909-4ac1-af00-7def636965e1.png"
                alt="Your logo"
                class="image is-64x64"
              />
            </div>
            <div class="column">
              <h1 class="title is-3">Pricing</h1>
            </div>
          </div>
        </div>
      </div>
    </header>

    <!-- Pricing plans -->
    <section class="section">
      <div class="container">
        <div class="columns is-centered">
          <div class="column is-one-third">
            <div class="card">
              <div class="card-content">
                <div class="content">
                  <h4 class="title is-4">Basic</h4>
                  <p class="subtitle is-5">$10/month</p>
                  <p>Basic Features Only</p>
                  <a href="#" class="button has-background-danger">Sign Up</a>
                </div>
              </div>
            </div>
          </div>

          <div class="column is-one-third">
            <div class="card">
              <div class="card-content">
                <div class="content">
                  <h4 class="title is-4">Standard</h4>
                  <p class="subtitle is-5">$20/month</p>
                  <p>Basic & Advanced Features</p>
                  <a href="#" class="button has-background-warning">Sign Up</a>
                </div>
              </div>
            </div>
          </div>

          <div class="column is-one-third">
            <div class="card">
              <div class="card-content">
                <div class="content">
                  <h4 class="title is-4">Premium</h4>
                  <p class="subtitle is-5">$30/month</p>
                  <p>All Premium Features</p>
                  <a href="#" class="button has-background-success">Sign Up</a>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </section>
  </body>
</html>
Enter fullscreen mode Exit fullscreen mode

You can control the button size by using some modifiers such as ‘is-small’, ‘is-normal’, ‘is-large’, etc.

<a href="#" class="button is-small">Sign Up</a>
<a href="#" class="button is-normal">Sign Up</a>
<a href="#" class="button is-medium">Sign Up</a>
Enter fullscreen mode Exit fullscreen mode
<!DOCTYPE html>
<html>
  <head>
    <title>My Basic Pricing Page</title>
    <link
      rel="stylesheet"
      href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.9.3/css/bulma.min.css"
    />
  </head>
  <body>
    <!-- Header with logo and heading -->
    <header class="hero is-custom">
      <div class="hero-body">
        <div class="container">
          <div class="columns">
            <div class="column is-one-quarter">
              <img
                src="https://user-images.githubusercontent.com/69134468/235296390-11fdb2a0-2909-4ac1-af00-7def636965e1.png"
                alt="Your logo"
                class="image is-64x64"
              />
            </div>
            <div class="column">
              <h1 class="title is-3">Pricing</h1>
            </div>
          </div>
        </div>
      </div>
    </header>

    <!-- Pricing plans -->
    <section class="section">
      <div class="container">
        <div class="columns is-centered">
          <div class="column is-one-third">
            <div class="card">
              <div class="card-content">
                <div class="content">
                  <h4 class="title is-4">Basic</h4>
                  <p class="subtitle is-5">$10/month</p>
                  <p>Basic Features Only</p>
                  <a href="#" class="button is-small">Sign Up</a>
                </div>
              </div>
            </div>
          </div>

          <div class="column is-one-third">
            <div class="card">
              <div class="card-content">
                <div class="content">
                  <h4 class="title is-4">Standard</h4>
                  <p class="subtitle is-5">$20/month</p>
                  <p>Basic & Advanced Features</p>
                  <a href="#" class="button is-normal">Sign Up</a>
                </div>
              </div>
            </div>
          </div>

          <div class="column is-one-third">
            <div class="card">
              <div class="card-content">
                <div class="content">
                  <h4 class="title is-4">Premium</h4>
                  <p class="subtitle is-5">$30/month</p>
                  <p>All Premium Features</p>
                  <a href="#" class="button is-medium">Sign Up</a>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </section>
  </body>
</html>
Enter fullscreen mode Exit fullscreen mode

You can transform the text by using modifiers such as ‘is-capitalized’, ‘is-lowercase’, ‘is-uppercase’, etc.

<!DOCTYPE html>
<html>
  <head>
    <title>Pricing Page</title>
    <link
      rel="stylesheet"
      href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.9.3/css/bulma.min.css"
    />
  </head>
  <body>
    <!-- Header with logo and heading -->
    <header class="hero is-custom">
      <div class="hero-body">
        <div class="container">
          <div class="columns">
            <div class="column is-one-quarter">
              <img
                src="https://user-images.githubusercontent.com/69134468/235296390-11fdb2a0-2909-4ac1-af00-7def636965e1.png"
                alt="Your logo"
                class="image is-64x64"
              />
            </div>
            <div class="column">
              <h1 class="title is-3">Pricing</h1>
            </div>
          </div>
        </div>
      </div>
    </header>

    <!-- Pricing plans -->
    <section class="section">
      <div class="container">
        <div class="columns is-centered">
          <div class="column is-one-third">
            <div class="card">
              <div class="card-content">
                <div class="content">
                  <h4 class="title is-4">Basic</h4>
                  <p class="subtitle is-5">$10/month</p>
                  <p>Basic Features Only</p>
                  <a href="#" class="button is-uppercase">Sign Up</a>
                </div>
              </div>
            </div>
          </div>

          <div class="column is-one-third">
            <div class="card">
              <div class="card-content">
                <div class="content">
                  <h4 class="title is-4">Standard</h4>
                  <p class="subtitle is-5">$20/month</p>
                  <p>Basic & Advanced Features</p>
                  <a href="#" class="button is-italic">Sign Up</a>
                </div>
              </div>
            </div>
          </div>

          <div class="column is-one-third">
            <div class="card">
              <div class="card-content">
                <div class="content">
                  <h4 class="title is-4">Premium</h4>
                  <p class="subtitle is-5">$30/month</p>
                  <p>All Premium Features</p>
                  <a href="#" class="button is-underlined">Sign Up</a>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </section>
  </body>
</html>
Enter fullscreen mode Exit fullscreen mode

You can also change the text weight, font family, and so on by similarly using different modifiers.

Need to generate random text based on a regular expression for testing and generating sample data.? Use our online tool to create random text from RegEx.

Progress Bar

To add a progress bar using Bulma, you can use the progress class on an < progress > HTML element. The value attribute sets the current progress value, and the max attribute sets the maximum progress value.

You can use modifiers to add more effects to the progress bar, just like with buttons. For example, you can add “is-success” or “is-danger” to change the color of the progress bar. To create the motion effect, exclude the “value” attribute from the HTML element. To adjust the size of the progress bar, you can apply the modifiers “is-small”, “is-medium”, and so on.

<!DOCTYPE html>
<html>
  <head>
    <title>Bulma CSS</title>

    <!--Bulma CDN-->
    <link
      rel="stylesheet"
      href="https://cdn.jsdelivr.net/npm/bulma@0.9.3/css/bulma.min.css"
    />
  </head>
  <body>
    <header class="hero is-custom">
      <div class="hero-body">
        <div class="container">
          <div class="columns">
            <div class="column is-one-quarter">
              <img
                src="https://user-images.githubusercontent.com/69134468/235296390-11fdb2a0-2909-4ac1-af00-7def636965e1.png"
                alt="Your logo"
                class="image is-64x64"
              />
            </div>
            <div class="column">
              <h1 class="title is-3">Task Status</h1>
            </div>
          </div>
        </div>
      </div>
    </header>
    <h3 class="subtitle is-4 has-text-warning-dark mt-3 ml-3">
      Task deadline approaching 
    </h3>
    <progress class="progress is-warning ml-3" value="30" max="100"></progress>
    <h3 class="subtitle is-4 has-text-danger mt-3 ml-3">Error encountered!</h3>
    <progress class="progress is-danger ml-3" value="40" max="100"></progress>
    <h3 class="subtitle is-4 has-text-info mt-3 ml-3">Task in progress...</h3>
    <progress class="progress is-info ml-3" max="100"></progress>
    <h3 class="subtitle is-4 has-text-success mt-3 ml-3">
      Task successfully completed
    </h3>
    <progress class="progress is-success ml-3" value="100" max="100"></progress>
  </body>
</html>
Enter fullscreen mode Exit fullscreen mode

User Input

Bulma provides a set of form control elements to collect user-inputted information. Some of these elements include text input, textarea, checkbox, radio buttons, and dropdown menus.

<form class="ml-2">
    <div class="field">
      <label class="label">Name</label>
      <div class="control">
        <input class="input is-success" type="text" placeholder="Enter your name">
      </div>
    </div>
        <div class="field">
      <label class="label">Email</label>
      <div class="control">
        <input class="input is-success" type="email" placeholder="Enter your email address">
      </div>
    </div>
    <div class="field">
      <label class="label">Comments</label>
      <div class="control">
        <textarea class="textarea" placeholder="Enter your message"></textarea>
      </div>
    </div>
    <div class="field">
      <label class="label">Language</label>
      <div class="control">
        <div class="select">
          <select>
            <option>Select language</option>
            <option>Hindi</option>
            <option>English</option>
            <option>French</option>
          </select>
        </div>
      </div>
    </div>
  <div class="field">
    <label class="label">Gender</label>
    <div class="control">
      <label class="radio">
        <input type="radio" name="gender" value="male">
        Male
      </label>
      <label class="radio">
        <input type="radio" name="gender" value="female">
        Female
      </label>
      <label class="radio">
        <input type="radio" name="gender" value="other">
        Other
      </label>
    </div>
  </div>

    <div class="field">
      <div class="control">
        <label class="checkbox">
          <input type="checkbox">
           I agree to the terms and conditions.
        </label>
      </div>
    </div>
    <div class="field">
      <div class="control">
        <button class="button is-success">Submit</button>
      </div>
    </div>
  </form>
Enter fullscreen mode Exit fullscreen mode
<!DOCTYPE html>
<html>
  <head>
    <title>Bulma CSS</title>

    <!--Bulma CDN-->
    <link
      rel="stylesheet"
      href="https://cdn.jsdelivr.net/npm/bulma@0.9.3/css/bulma.min.css"
    />
  </head>
  <body>
    <header class="hero is-custom">
      <div class="hero-body">
        <div class="container">
          <div class="columns">
            <div class="column is-one-quarter">
              <img
                src="https://user-images.githubusercontent.com/69134468/235296390-11fdb2a0-2909-4ac1-af00-7def636965e1.png"
                alt="Your logo"
                class="image is-64x64"
              />
            </div>
            <div class="column">
              <h1 class="title is-3">Create LambdaTest Account</h1>
            </div>
          </div>
        </div>
      </div>
    </header>
    <form class="ml-2">
  <div class="field">
    <label class="label">Name</label>
    <div class="control">
      <input class="input is-success" type="text" placeholder="Enter your name">
    </div>
  </div>
      <div class="field">
    <label class="label">Email</label>
    <div class="control">
      <input class="input is-success" type="email" placeholder="Enter your email address">
    </div>
  </div>
  <div class="field">
    <label class="label">Comments</label>
    <div class="control">
      <textarea class="textarea" placeholder="Enter your message"></textarea>
    </div>
  </div>
  <div class="field">
    <label class="label">Language</label>
    <div class="control">
      <div class="select">
        <select>
          <option>Select language</option>
          <option>Hindi</option>
          <option>English</option>
          <option>French</option>
        </select>
      </div>
    </div>
  </div>
<div class="field">
  <label class="label">Gender</label>
  <div class="control">
    <label class="radio">
      <input type="radio" name="gender" value="male">
      Male
    </label>
    <label class="radio">
      <input type="radio" name="gender" value="female">
      Female
    </label>
    <label class="radio">
      <input type="radio" name="gender" value="other">
      Other
    </label>
  </div>
</div>

  <div class="field">
    <div class="control">
      <label class="checkbox">
        <input type="checkbox">
         I agree to the terms and conditions.
      </label>
    </div>
  </div>
  <div class="field">
    <div class="control">
      <button class="button is-success">Submit</button>
    </div>
  </div>
</form>
  </body>
</html>
Enter fullscreen mode Exit fullscreen mode

Column

Columns are a fundamental part of website layout and design, and building a column layout with Bulma is very simple:

  • Add a columns container

  • Add as many column elements as you want

You can set different widths for individual columns. Bulma provides several column width modifiers that can be added to one or more child column elements. The other columns will adjust their widths automatically.

In the Bulma CSS, columns width can be changed to various options like

is-one-quarter 1/4
is-one-third 1/3
is-half 1/2
is-two-thirds 2/3
is-three-quarters 3/4

To use these modifiers, you simply add the modifier class to the child column element:

Code:

<div class="columns is-multiline">
  <!-- Product 1 -->
  <div class="column">
    <div class="card is-one-quarter has-background-grey-light ml-2 mt-2">
      <div class="card-image">
        <figure class="image is-4by3">
          <img
            src="https://user-images.githubusercontent.com/69134468/235297320-094a5a83-eb06-4933-acf5-735081d22557.png"
            alt="Product 1"
          />
        </figure>
      </div>
      <div class="card-content">
        <p class="title is-4">Automated Browser Screenshot Testing</p>
        <p class="subtitle is-6">Free</p>
        <div class="content">
          <p>
            Take Instant Automated Screenshots Across Multiple Browsers In A
            Single Click.
          </p>
        </div>
      </div>
    </div>
  </div>


  <!-- Product 2 -->
  <div class="column">
    <div class="card is-one-quarter has-background-grey-light mt-2">
      <div class="card-image">
        <figure class="image is-4by3">
          <img
            src="https://user-images.githubusercontent.com/69134468/235297322-d7ca1ae4-7abd-41ce-adc5-ec3db2b134f0.png"
            alt="Product 2"
          />
        </figure>
      </div>
      <div class="card-content">
        <p class="title is-4">LT Browser 2.0</p>
        <p class="subtitle is-6">Free</p>
        <div class="content">
          <p>Next-gen browser to build, test & debug mobile websites.</p>
        </div>
      </div>
    </div>
  </div>


  <!-- Product 3 -->
  <div class="column">
    <div class="card is-one-quarter has-background-grey-light mt-2">
      <div class="card-image">
        <figure class="image is-4by3">
          <img
            src="https://user-images.githubusercontent.com/69134468/235297323-b72aa7db-0e28-41fc-9cb4-3597de62557f.png"
            alt="Product 3"
          />
        </figure>
      </div>
      <div class="card-content">
        <p class="title is-4">LT Debug</p>
        <p class="subtitle is-6">Free</p>
        <div class="content">
          <p>
            Debug web pages on-the-fly with nine essential debugging tools. This
            Chrome extension makes debugging any web page a breeze.
          </p>
        </div>
      </div>
    </div>
  </div>


  <!-- Product 4 -->
  <div class="column">
    <div class="card is-one-quarter has-background-grey-light mr-2 mt-2">
      <div class="card-image">
        <figure class="image is-4by3">
          <img
            src="https://user-images.githubusercontent.com/69134468/235297327-187e03a5-81c2-4657-851e-55efc10b569a.png"
            alt="Product 4"
          />
        </figure>
      </div>
      <div class="card-content">
        <p class="title is-4">AI-Powered Test Analytics</p>
        <p class="subtitle is-6">Free</p>
        <div class="content">
          <p>
            Assess high-impact quality issues with detailed Test Analytics &
            Observability Suite.
          </p>
        </div>
      </div>
    </div>
  </div>
</div>
Enter fullscreen mode Exit fullscreen mode
<!DOCTYPE html>
<html>
  <head>
    <title>Bulma CSS</title>

    <!--Bulma CDN-->
    <link
      rel="stylesheet"
      href="https://cdn.jsdelivr.net/npm/bulma@0.9.3/css/bulma.min.css"
    />
  </head>
  <body>
    <header class="hero is-custom">
      <div class="hero-body">
        <div class="container">
          <div class="columns">
            <div class="column is-one-quarter">
              <img
                src="https://user-images.githubusercontent.com/69134468/235296390-11fdb2a0-2909-4ac1-af00-7def636965e1.png"
                alt="Your logo"
                class="image is-64x64"
              />
            </div>
            <div class="column">
              <h1 class="title is-3">Buy our Products</h1>
            </div>
          </div>
        </div>
      </div>
    </header>
    <div class="columns is-multiline">
      <!-- Product 1 -->
      <div class="column">
        <div class="card is-one-quarter has-background-grey-light ml-2 mt-2">
          <div class="card-image">
            <figure class="image is-4by3">
              <img src="https://user-images.githubusercontent.com/69134468/235297320-094a5a83-eb06-4933-acf5-735081d22557.png" alt="Product 1" />
            </figure>
          </div>
          <div class="card-content">
            <p class="title is-4">Automated Browser Screenshot Testing</p>
            <p class="subtitle is-6">Free</p>
            <div class="content">
              <p>
                Take Instant Automated Screenshots Across Multiple Browsers In A Single Click.
              </p>
            </div>
          </div>
        </div>
      </div>

      <!-- Product 2 -->
      <div class="column">
        <div class="card is-one-quarter has-background-grey-light mt-2">
          <div class="card-image">
            <figure class="image is-4by3">
              <img src="https://user-images.githubusercontent.com/69134468/235297322-d7ca1ae4-7abd-41ce-adc5-ec3db2b134f0.png" alt="Product 2" />
            </figure>
          </div>
          <div class="card-content">
            <p class="title is-4">LT Browser 2.0</p>
            <p class="subtitle is-6">Free</p>
            <div class="content">
              <p>
                Next-gen browser to build, test & debug
mobile websites.
              </p>
            </div>
          </div>
        </div>
      </div>

      <!-- Product 3 -->
      <div class="column">
        <div class="card is-one-quarter has-background-grey-light mt-2">
          <div class="card-image">
            <figure class="image is-4by3">
              <img src="https://user-images.githubusercontent.com/69134468/235297323-b72aa7db-0e28-41fc-9cb4-3597de62557f.png" alt="Product 3" />
            </figure>
          </div>
          <div class="card-content">
            <p class="title is-4">LT Debug</p>
            <p class="subtitle is-6">Free</p>
            <div class="content">
              <p>
Debug web pages on-the-fly with nine essential debugging tools. This Chrome extension makes debugging any web page a breeze.
              </p>
            </div>
          </div>
        </div>
      </div>

      <!-- Product 4 -->
      <div class="column">
        <div class="card is-one-quarter has-background-grey-light mr-2 mt-2">
          <div class="card-image">
            <figure class="image is-4by3">
              <img src="https://user-images.githubusercontent.com/69134468/235297327-187e03a5-81c2-4657-851e-55efc10b569a.png" alt="Product 4" />
            </figure>
          </div>
          <div class="card-content">
            <p class="title is-4">AI-Powered Test Analytics</p>
            <p class="subtitle is-6">Free</p>
            <div class="content">
              <p>
                Assess high-impact quality issues with detailed Test Analytics & Observability Suite.
              </p>
            </div>
          </div>
        </div>
      </div>
    </div>
  </body>
</html>
Enter fullscreen mode Exit fullscreen mode

Need realistic test data? Use our free online Test Data Generator tool to create realistic data for your testing needs. Get started now and save time and effort.

Best Practices for using Bulma CSS

Knowing the best practices for using Bulma allows you to leverage the framework effectively, such as you can leverage Bulma’s pre-built components, grid system, and styling classes to build a responsive website quickly. Let’s look at some of the best practices:

Follow the Grid System

Bulma provides a flexible grid system that helps create responsive layouts. To create a grid structure for a webpage, you can use the columns and column classes, along with other related classes such as is-three-quarters, is-two-thirds, is-half, and is-one-third.

<div class="columns">
  <div class="column is-half">
    <!-- First Column Content -->
  </div>
  <div class="column is-half">
    <!-- Second Column Content -->
  </div>
</div>
Enter fullscreen mode Exit fullscreen mode

Use Bulma Classes

Bulma CSS provides a set of classes that you can use to style your HTML elements. Some of the classes are button, card, container, and nav. Use these classes to style your webpage. For example, use the button class to style a button element.

<button class="button">Click here</button>
Enter fullscreen mode Exit fullscreen mode

Use Bulma Modifiers

Bulma offers a variety of modifiers that you can add to classes to modify their behavior without having to write a lot of custom CSS. These modifiers allow you to modify the responsiveness of the element, customize the look of Bulma elements, and so on.

Some modifiers, such as is-primary, is-info, is-success, is-warning, or is-danger, can be used to apply different color variations. Here is an example using the is-primary class:

<button class="button is-primary">Click here</button>
Enter fullscreen mode Exit fullscreen mode

Follow Modularity

As discussed above, Bulma CSS is fully modular. This allows you to use individual components independently. Bulma makes it easy only to use the components you need for your project. This best practice can help you create clear, efficient, and maintainable code. Let’s say you only want the Bulma columns, you can import it directly.

@import "bulma/sass/utilities/_all.sass"
@import "bulma/sass/grid/columns.sass"
Enter fullscreen mode Exit fullscreen mode

Use Responsive Design Features

Bulma offers built-in responsive design features to make your design optimal across different screen sizes. Bulma handles responsiveness through classes such as is-full-mobile, is-hidden-mobile, is-desktop, etc.

<!DOCTYPE html>
<html>
  <head>
    <title>Bulma CSS</title>


    <!--Bulma CDN-->
    <link
      rel="stylesheet"
      href="https://cdn.jsdelivr.net/npm/bulma@0.9.3/css/bulma.min.css"
    />
  </head>
  <body>
    <div class="columns">
      <div class="column is-one-third is-full-mobile">
        <p>
          This column takes up one-third of the width on desktop and full width
          on mobile.
        </p>
      </div>
      <div class="column is-one-third is-full-mobile">
        <p>
          This column takes up one-third of the width on desktop and full width
          on mobile.
        </p>
      </div>
      <div class="column is-desktop is-one-third is-hidden-mobile">
        <p>
          This column takes up one-third of the width on desktop and is only
          visible in desktop screens, hidden on mobile
        </p>
      </div>
    </div>
  </body>
</html>
Enter fullscreen mode Exit fullscreen mode

Optimizing Website Performance using Bulma CSS

In this section, we will discuss how you can optimize your website performance using the Bulma framework.

Use the Minified Version

When using Bulma CSS, always use the minified version (with the .min.css extension). Minified files are smaller in size and load faster. To include the minified version of Bulma CSS, you can use the following code:

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.3/css/bulma.min.css">
Enter fullscreen mode Exit fullscreen mode

The non-minified version of Bulma CSS looks something like this:

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.3/css/bulma.css">
Enter fullscreen mode Exit fullscreen mode

Use the Modularity

Import only what you need. If you want to use the button on your webpage, only include the button style in your code. This will improve the loading time of a website and overall optimize the website’s performance.

@import "bulma/sass/utilities/_all.sass"
@import "bulma/sass/elements/button.sass"
Enter fullscreen mode Exit fullscreen mode

Frequent DOM Manipulation

Frequent DOM manipulations can negatively impact website performance. If you make small changes, the browser has to re-render the page, and it can be costly.

CSS frameworks like Bulma can help reduce manipulations. These frameworks provide pre-built components and CSS classes that can help create an interactive UI without writing a lot of custom CSS.

Caching

The Bulma CSS framework can increase website performance by using caching. Bulma is known for its efficiency and lightweight nature, and its code is more optimized for caching. In comparison to custom CSS, Bulma CSS code can be cached better.

To increase cache performance, you can use minified CSS files and CDN support. Minified files are smaller and load faster, while a CDN (Content Delivery Network) is a network of servers distributed worldwide. When a user requests a CSS file, it is served from the nearest server, improving caching performance.

Minimizing HTTP requests

By minimizing HTTP requests, you can increase website performance. This will improve SEO ranking, user experience, and faster load times.

The Bulma CSS framework can optimize website performance. You can use minified files, which make files smaller and minimize HTTP requests. Additionally, you can use Bulma’s CDN support, which reduces request latency. Combining smaller files into a single file can also reduce the number of requests the browser has to make.

Bonus: Bulma vs. Bootstrap

Bulma and Bootstrap are popular CSS frameworks used to build responsive and mobile-first websites.

They are free and open-source CSS frameworks with some key differences.

Design

Bulma provides a modern and minimalist design that is easy to customize. It uses a simple and flexible grid system based on the CSS Flexbox module.

Bootstrap has a more traditional design with a heavy reliance on pre-built components such as buttons, forms, navigation menus, etc.

Let’s take a scenario where we want to customize the appearance of form input (font size & color).

With Bulma:

HTML:

<input class="input my-input" type="text" placeholder="Enter text">
Enter fullscreen mode Exit fullscreen mode

CSS:

.my-input {
  font-size: 18px;
  color: blue;
}
Enter fullscreen mode Exit fullscreen mode

We have added the custom class “my-input.” This code will customize our input form fields, such as setting the font size to 18px and the color to blue. You have direct control over the specific properties that you want to customize.

With Bootstrap:

HTML:

<input class="form-control my-input" type="text" placeholder="Enter text">
Enter fullscreen mode Exit fullscreen mode

CSS:

.my-input {
  font-size: 18px !important;
  color: blue !important;
}
Enter fullscreen mode Exit fullscreen mode

Same as Bulma, we have added a custom class called “my-input” to our input element. To override the default style and use our customizations, we used the “!important” declaration in CSS. This ensures that our custom styles take precedence over the default styles.

It is important to note that the use of “!important” should be done sparingly, as it can make your stylesheets difficult to maintain.

Flexibility

Both frameworks are suitable for creating responsive websites, but Bulma is more flexible than Bootstrap. Bulma’s styling is minimal, which means you have more control over the appearance of individual components, such as font size, color, etc.

Bootstrap has a lot of pre-built styles that are applied to elements by default, which can make it more challenging to customize the appearance of a component.

Same as above, it becomes challenging when it comes to customizing the default style of a Bootstrap element, but in the case of Bulma, it is more flexible.

Easy-to-learn syntax

Both Bulma and Bootstrap have easy-to-learn syntax, but they have slight differences in their approach. Bulma has a more straightforward and self-explanatory syntax. Bulma has simple and readable class names, such as .button or .title. It also has direct modifiers, such as .is-primary or .is-large, which makes it easy to understand and know their purpose.

The Bootstrap syntax may require consulting the documentation to fully grasp the class naming conventions.

Bulma:

<button class="button is-primary is-rounded is-large">Click here</button>
Enter fullscreen mode Exit fullscreen mode

Bootstrap:

<button class="btn btn-primary rounded-lg btn-lg">Click here</button>
Enter fullscreen mode Exit fullscreen mode

In both the above examples, the intention is to style the button with a primary color, rounded corners, and increased size. The Bulma syntax looks easy to understand, but the Bootstrap syntax looks abbreviated and requires some familiarity with the framework.

Community Support

Bootstrap is a popular framework with a large user base and support community. Therefore, finding solutions to advanced problems is more likely to be achieved with Bootstrap than with Bulma.

On StackOverflow, there have been over 3k questions asked about the Bulma CSS framework. Bulma has over 47.3k Stars on GitHub.

Need random text for your project? Our Lorem Ipsum Generator lets you easily generate filler text. Choose the number of paragraphs, words, or characters you need.

Conclusion

Bulma is a free, open-source, and lightweight CSS framework based on Flexbox layout. It provides CSS classes to help you style your HTML code, allowing developers to implement CSS on web pages more efficiently than plain CSS.

In this guide, we looked at the Bulma CSS framework in detail, its features and components, best practices for using Bulma, and how Bulma can help optimize website performance.

So, if developers have to import only what they need, developers have to style web pages without writing a single line of JavaScript code and more. This all can be done by using the Bulma CSS framework.

Top comments (0)