I managed to create this layout using only Bootstrap 5, without any CSS customization.
Below is the HTML code I used:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Bootstrap</title>
<article>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/bootstrap/dist/css/bootstrap.min.css"
integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh"
crossorigin="anonymous"
/>
<link rel="stylesheet" href="bs-justify.css" />
<script
src="https://code.jquery.com/jquery-3.4.1.slim.min.js"
integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n"
crossorigin="anonymous"
></script>
<script
src="https://cdn.jsdelivr.net/npm/bootstrap/dist/umd/popper.min.js"
integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo"
crossorigin="anonymous"
></script>
<script
src="https://cdn.jsdelivr.net/npm/bootstrap/dist/js/bootstrap.min.js"
integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6"
crossorigin="anonymous"
></script>
</article>
</head>
<body>
<br>
<h4 class="display4 text-center"><i>Understanding the Grid System</i></h2>
<div class="row">
<div class="col-4 bg-dark text-light border">This is a 4 unit column</div>
<div class="col-4 bg-dark text-light border">This is a 4 unit column</div>
<div class="col-4 bg-dark text-light border">This is a 4 unit column</div>
<div class="col bg-dark text-light border text-center">This is an automatic unit</div>
<div class="col bg-dark text-light border text-right">This is an automatic unit</div>
<div class="col bg-dark text-light border text-left">This is an automatic unit</div>
<div class="col bg-dark text-light border">This is an automatic unit</div>
</div>
<br>
</body>
</html>
Hello everyone! As a beginner student, I am seeking some guidance on why Bootstrap's default settings lead to overflowing width by default. Any insights would be greatly appreciated!