ShapeYourPath
(current)
Run Code
Live Code Editor- Bootstrap 5 Column Horizontal Alignment
Source Code
<!doctype html> <html lang="en"> <head> <!-- Required meta tags --> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <!-- Bootstrap CSS --> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css" rel="stylesheet"> <title>Bootstrap 5 Column Horizontal Alignment</title> <style type="text/css"> row{ width:100%; height:200px; background-color:#F8F9FA; } </style> </head> <body> <h1 class="text-center">Horizontal Column Alignment</h1> <p class="text-justify text-center"> In this example, you will learn how to align container horizontally along x-axis using .justify-content-start class. In this, alignment starts from left side of the container. </p> <div class="container bg-light pt-4" > <div class="row justify-content-start"> <div class="col-4"> First Column of the existing row </div> <div class="col-4 "> Second Column of the existing row </div> </div> </div> <!-- Option 1: Bootstrap Bundle with Popper --> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/js/bootstrap.bundle.min.js"></script> </body> </html>
Output :
Running