I need assistance with setting up responsive columns in my HTML code using Bootstrap. Specifically, I want 4 columns per row on desktop, 3 columns per row on tablet, and 2 columns per row on mobile devices. Despite searching on Stack Overflow, I couldn't find a clear answer or explanation.
Here is the code I've written:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>My Bootstrap Code</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-xxxxxxx" crossorigin="anonymous" />
</head>
<body>
<div class="row">
<div class="col-md-3 col-sm-6 col-xs-12">box 1</div>
<div class="col-md-3 col-sm-6 col-xs-12">box 2</div>
<div class="col-md-3 col-sm-6 col-xs-12">box 3</div>
<div class="col-md-3 col-sm-6 col-xs-12">box 4</div>
</div>
<!-- more rows here -->
</body>
<script src="https://cdn.jsdelivr.net/npm/bootstrap/dist/js/bootstrap.bundle.min.js" integrity="sha384-yyyyyyyGwggsvTBZTKJ7uNxdKNRXcL81TWvqlDtkzTeC5qbT52gblj/VgX0ytBvj9Lu" crossorigin="anonymous"></script>
</html>