Open In App

Bulma Spacing

Bulma has many facilities of classes to easily style elements in HTML. It includes various responsive padding and margin classes for modification of the appearance of elements. Spacing utilities have no breakpoints symbols to apply to the breakpoints.

Following syntax are used in the various classes for adding spacing.



Property: There are two ways of adding spacing to the elements.

Configuration Sides: This allows users to add spacing in content to a specific side wherever required.



List of all Size: This allows users to add a specific amount of spacing to a level.

Breakpoint: Breakpoints are points where the website content can adjust according to the device and allow to show the best layout to the user.  

Example1:




<!DOCTYPE html>
<html>
 
<head>
    <title>Bulma Panel</title>
 
    <link rel='stylesheet' href=
     
    <style>
        p {
            border: 2px solid green;
        }
    </style>
</head>
 
<body>
    <h1 class="is-size-2">
        GeeksforGeeks
    </h1>
     
    <b>Bulma Space Class</b>
    <br>
     
    <div class="container">
        <p class="mr-0 pt-3 has-text-light
                has-background-success">
            GeeksforGeeks
        </p>
 
 
        <br>
        <p class="ml-5 has-text-light
                has-background-success">
            GeeksforGeeks
        </p>
 
 
        <br>
        <p class="pb-5 has-text-light
                has-background-success">
            GeeksforGeeks
        </p>
 
    </div>
</body>
 
</html>

Output:

Bulma Space Class

Example2: In the below code, we will make use of the ml and mr classes.




<!DOCTYPE html>
<html>
 
<head>
    <title>Bulma Panel</title>
 
    <link rel='stylesheet' href=
     
    <style>
        p {
            border: 2px solid green;
        }
    </style>
</head>
 
<body>
    <center>
    <h1 class="is-size-2">
        GeeksforGeeks
    </h1>
     
    <b>Bulma Space Class</b>
    <br>
     
    <div class="container">
        <p class="ml-1 mr-1 has-text-light
                has-background-success">
            GeeksforGeeks
        </p>
 
 
        <br>
        <p class="ml-2 mr-2 has-text-light
                has-background-success">
            GeeksforGeeks
        </p>
<br>
        <p class="ml-3 mr-3 has-text-light
                has-background-success">
            GeeksforGeeks
        </p>
<br>
        <p class="ml-4 mr-4 has-text-light
                has-background-success">
            GeeksforGeeks
        </p>
<br>
        <p class="ml-5 mr-5 has-text-light
                has-background-success">
            GeeksforGeeks
        </p>
 
    </div>
    </center>
</body>
 
</html>

Output:

 


Article Tags :