I am attempting to display a content box consistently on both desktop and mobile by utilizing a fixed width and overflow property.
:root {
--box: rgb(20, 33, 150);
--box1: rgb(55, 75, 255);
--background: rgb(147, 158, 255);
}
body {
-webkit-font-smoothing: antialiased;
font-family: "Open Sans";
font-weight: 400;
background-color: var(--background);
}
.squad-table>.col-12 {
border: 2px solid var(--background);
display: flex;
justify-content: center;
overflow-x: auto;
}
.wrapper {
width: 1000px;
display: flex;
justify-content: space-between;
}
.wrapper>.row {
width: 500px;
margin:3px;
}
.box {
background-color: var(--box);
font-size: 1.2rem;
color: #fff;
}
.squad-box {
padding-bottom: 15px;
padding-top: 15px;
background-color: var(--box1);
}
.count-box {
text-align: left;
-webkit-border-top-right-radius: 30px;
-moz-border-radius-topright: 30px;
border-top-right-radius: 30px;
background-color: var(--box1);
}
.team-box {
display: flex;
justify-content: center;
}
.team-box-inner {
padding: 10px;
display: flex;
justify-content: center;
align-items: center;
background-color: var(--box);
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<!-- <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400" rel="stylesheet"> -->
<!-- <link rel="stylesheet" href="css/bootstrap.min.css"> -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO"
crossorigin="anonymous">
<link rel="stylesheet" href="css/style.css">
<title>Learn HTML</title>
</head>
<body>
<div class="container">
<div class="row test">
<div class="col-12 mx-auto">
<h1 class=" display-1 text-center">Squad</h1>
</div>
</div>
<div class="row squad-table">
<div class="col-12">
<div class="wrapper">
<div class="row box text-center">
<div class="col-4 count-box">Team 1</div>
<div class="col-8 space-box">space</div>
<div class="col-12 squad-box">
<div class="row">
<div class="col-3 team-box">
<div class="team-box-inner">name</div>
</div>
<div class="col-3 team-box">
<div class="team-box-inner">name</div>
</div>
<div class="col-3 team-box">
<div class="team-box-inner">name</div>
</div>
<div class="col-3 team-box">
<div class="team-box-inner">name</div>
</div>
</div>
</div>
</div>
<div class="row box text-center">
<div class="col-4 count-box">Team 1</div>
<div class="col-8 space-box">space</div>
<div class="col-12 squad-box">
<div class="row">
<div class="col-3 team-box">
<div class="team-box-inner">name</div>
</div>
<div class="col-3 team-box">
<div class="team-box-inner">name</div>
</div>
<div class="col-3 team-box">
<div class="team-box-inner">name</div>
</div>
<div class="col-3 team-box">
<div class="team-box-inner">name</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- JS files -->
<!-- <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49"
crossorigin="anonymous"></script>
<script src="js/bootstrap.min.js"></script> -->
</body>
</html>
Just to note, I utilized bootstrap version 4.1.3