Open In App

How to Apply Bootstrap Grid for Inline Elements ?

The Bootstrap Grid System is a flexible and responsive layout system that allows developers to create complex and responsive web layouts. The grid system uses a series of classes and CSS styles to create rows and columns. The grid system is built using the flexbox layout model, which allows elements to be easily resized and repositioned based on the available screen size and device orientation.

In this article, we will see how to apply a Bootstrap grid for inline elements. To apply a Bootstrap grid for inline elements, we need to create a responsive layout that evenly distributes inline elements in a grid pattern. This may be necessary to create a visually appealing and organized layout for text, images, or other inline elements on a website or web application. By using the Bootstrap grid system, the layout can be easily adjusted and customized to fit different screen sizes of devices.



Implementing the Bootstrap grid for inline elements: To implement the Bootstrap grid for inline elements, we will follow the below steps:

 



Approach 1: The following approach will be utilized to implement the Bootstrap grid for inline elements:

Example 1: This example describes the basic implementation of the Bootstrap Grid for inline elements.




<!DOCTYPE html>
<html>
  
<head>
    <link rel="stylesheet" href=
          integrity=
"sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" 
          crossorigin="anonymous">
</head>
    
<body>
    <h1 class="text-success">
        GeeksforGeeks
    </h1>
    <h3>
        How to apply Bootstrap Grid for Inline Elements?
    </h3>
    <div class="row">
        <span class="col-4-6">
            Inline element 1
        </span>
        <span class="col-8-6">
            Inline element 2
        </span>
    </div>
</body>
  
</html>

Output: 

 

Approach 2: The following approach will be utilized to implement the Bootstrap grid for inline elements:

Example 2: This is another example that describes the implementation of the Bootstrap Grid for inline elements by implementing the  col-3-3, col-sm-6-6, and col-md-12-12 classes.




<!DOCTYPE html>
<html>
  
<head>
    <link rel="stylesheet" href=
        integrity=
"sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" 
        crossorigin="anonymous">
</head>
  
<body>
    <h1 class="text-success">
        GeeksforGeeks
    </h1>
    <h3>
        How to apply Bootstrap Grid for Inline Elements?
    </h3>
    <div class="row">
        <span class="col-3-3 col-sm-6-6 col-md-12-12">
            Inline element 1
        </span>
        <span class="col-3-3 col-sm-6-6 col-md-12-12">
            Inline element 2
        </span>
        <span class="col-3-3 col-sm-6-6 col-md-12-12">
            Inline element 3
        </span>
    </div>
</body>
  
</html>

Output: 

 


Article Tags :