Horje
How to align content bottom on Bootstrap 4 col ?

Bootstrap Grid System allows up to 12 columns across the page. You can use each of them individually or merge them together for wider columns. All combinations of values summing up to 12 can be used. In this article, we will learn about How to align content bottom on Bootstrap 4 col.

Using align-items-end

  • Make a basic structure of the web page With the help of different elements. Use different Bootstrap utility classes to give style to the element.
  • The five columns have Bootstrap utility class col wrapped inside the div element.
  • This div element has the class align-items-end to align all the content of the columns at the bottom.

Example: All the columns in the entire row use align-items-end on the row. This will help to align the content of all the cols in the end.

HTML

<!DOCTYPE html>
<html lang="en">
  
<head>
    <meta charset="utf-8">
    <meta name="viewport" 
          content="width=device-width, 
                   initial-scale=1">
    <link rel="stylesheet" href=
</head>
  
<body>
    <div class="container">
        <h2 class="text-center text-success">
            GeeksforGeeks
        </h2>
        <h2>
              How to align content bottom
              on Bootstrap 4 col ?
          </h2>
        <div class="row border align-items-end">
            <div class="col">
                1 (row align-items-end)
                <br />
                2<br />
                3<br />
            </div>
            <div class="col">
                1
            </div>
            <div class="col">
                2
            </div>
            <div class="col">
                3
            </div>
            <div class="col">
                4
            </div>
        </div>
    </div>
</body>
  
</html>

Output:

z139

Using align-self-end

  • Make a basic structure of the web page With the help of different elements. Use different Bootstrap utility classes to give style to the element.
  • The five columns have Bootstrap utility class col wrapped inside the div element.
  • The last column has the class align-self-end to align the content of the particular column at the end.

Example: For a single column use align-self-end on the col. This will help to align the content of a particular col in the end.

HTML

<!DOCTYPE html>
<html lang="en">
  
<head>
    <meta charset="utf-8">
    <meta name="viewport" 
          content="width=device-width, 
                    initial-scale=1">
    <link rel="stylesheet" href=
</head>
  
<body>
    <div class="container">
        <h2 class="text-center text-success">
            GeeksforGeeks
        </h2>
        <h2>
              How to align content bottom
              on Bootstrap 4 col ?
          </h2>
        <div class="row border ">
            <div class="col">
                1 (row align-self-end)
                <br />
                2<br />
                3<br />
            </div>
            <div class="col">
                1
            </div>
            <div class="col">
                2
            </div>
            <div class="col">
                3
            </div>
            <div class="col align-self-end">
                4
            </div>
        </div>
    </div>
</body>
  
</html>

Output:

z140




Reffered: https://www.geeksforgeeks.org


Bootstrap

Related
How to create a Responsive Sidebar in Bootstrap? How to create a Responsive Sidebar in Bootstrap?
How to stick a div at the bottom left of the screen using Bootstrap5 ? How to stick a div at the bottom left of the screen using Bootstrap5 ?
How to move a container inside of another container in Bootstrap 5 ? How to move a container inside of another container in Bootstrap 5 ?
How to change Bootstrap Checkbox size ? How to change Bootstrap Checkbox size ?
How to add dropdown search bar in Bootstrap? How to add dropdown search bar in Bootstrap?

Type:
Geek
Category:
Coding
Sub Category:
Tutorial
Uploaded by:
Admin
Views:
13