Bootstrap 5.3 Grid System
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Bootstrap 5.3 Grid System Example</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container">
<h2>Bootstrap 5.3 Grid System Example</h2>
<div class="row">
<div class="col-md-4">Column 1</div>
<div class="col-md-4">Column 2</div>
<div class="col-md-4">Column 3</div>
</div>
<div class="row">
<div class="col-sm-6 col-md-3">Column 1</div>
<div class="col-sm-6 col-md-3">Column 2</div>
<div class="col-sm-6 col-md-3">Column 3</div>
<div class="col-sm-6 col-md-3">Column 4</div>
</div>
</div>
</body>
</html>
Code Output
Bootstrap 5.3 Grid System Example
Column 1
Column 2
Column 3
Column 1
Column 2
Column 3
Column 4
Grid System
Bootstrap provides a powerful grid system that allows you to create responsive layouts easily. The grid system is based on a 12-column layout, and you can use different classes to create rows and columns for your content.
-
.row
: Used to create a row to contain columns within it. Rows are flex containers and help in aligning columns horizontally..col
: The base class for creating a column. By default, it spans the entire width of the parent container..col-{breakpoint}-{number}
: Use this class to define the width of the column for different breakpoints. Replace{breakpoint}
withsm
,md
,lg
, orxl
, and{number}
with a value from 1 to 12 representing the number of columns to span.