The grid system in Bootstrap 5 is a powerful and flexible layout system that allows developers to create responsive and fluid grids for web pages or applications. It is based on a 12-column grid system that can be easily customized to create various column layouts depending on the screen size or device.
Here are some key features of the grid system in Bootstrap 5:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi" crossorigin="anonymous"> <link rel="stylesheet" href="css/base.css"> <style> .container{ background-color: grey; padding: 10px; } .row{ background-color: rgb(131, 181, 225); padding: 10px; } .col, .col-8, .col-6, .col-4, .col-md-8, .col-md-4 { background-color: pink; padding: 20px; border:1px solid red; } </style> </head> <body> <div class="container"> <div class="row"> <div class="col"></div> <div class="col"></div> <div class="col"></div> </div> <div class="row"> <div class="col"></div> <div class="col"></div> </div> <div class="row"> <div class="col-8"></div> <div class="col-4"></div> </div> <div class="row"> <div class="col"></div> <div class="col-6"></div> <div class="col"></div> </div> <div class="row"> <div class="col-md-8"></div> <div class="col-md-4"></div> </div> <div class="row row-cols-xxl-6 row-cols-xl-5 row-cols-lg-4 row-cols-md-4 row-cols-sm-2 row-cols-xs-1 "> <div class="col"></div> <div class="col"></div> <div class="col"></div> <div class="col"></div> <div class="col"></div> <div class="col"></div> </div> </div> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-OERcA2EqjJCMA+/3y+gxIOqMEjwtxJY7qPCqsdltbNJuaOe923+mo//f6V8Qbsw3" crossorigin="anonymous"></script> </body> </html> <!-- row row-cols-2 (1-6) row-cols-auto row-cols-xxl-6 row-cols-xl-5 row-cols-lg-4 row-cols-md-4 row-cols-sm-2 row-cols-xs-1 col col-1 (1-12) col-xxl-1 (1-12) col-xl-1 (1-12) col-lg-1 (1-12) col-md-1 (1-12) col-sm-1 (1-12) col-xs-1 (1-12) -->Live Preview
In summary, the grid system in Bootstrap 5 is a flexible and responsive layout system that allows developers to create modern and responsive web designs with ease, using a 12-column grid structure, container element, column classes, offset and nesting, and leveraging the power of CSS Flexbox.
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions