I am currently working on creating a div that contains some information, similar to the layout used on the Coinbase website. However, I am encountering issues with styling as I want this div to be responsive - horizontally aligned on larger devices and vertically aligned on smaller devices. My knowledge of CSS is limited, but I believe Flexbox might be the solution. Can you guide me on how to achieve this?
The goal is for the layout to look like the one on the Coinbase website. On larger screens, the content should appear in rows, while on smaller screens, it should switch to columns. Is there a Bootstrap class that can simplify this process? I am using Bootstrap for my project.
<!DOCTYPE html>
<html lang="en>
<head>
<meta charset="UTF-8>
<meta name="viewport" content="width=device-width, initial-scale=1.0>
<title>Document>
<style>
.container {
background: dodgerblue;
}
.section {
display: flex;
flex-shrink: 0;
width: 100%;
max-width: 1180px;
margin: 0px auto;
padding: 24px;
}
.box {
display: flex;
flex: 1 1 auto;
flex-direction: row;
justify-content: center;
color: rgb(255, 255, 255);
margin: 40px 0px;
}
h2 {
margin: 0px 0px 12px;
line-height: 48px;
font-size: 56px;
font-weight: 500;
}
.divChild {
line-height: 24px;
font-size: 16px;
opacity: 0.7;
}
.divChildBox {
flex: 1 1 0%;
text-align: center;
flex: 1 1 0%;
text-align: center;
flex: 1 1 0%;
text-align: center;
}
</style>
</head>
<body>
<div class="container">
<section class="section">
<div class="box">
<div class="divChildBox">
<h2>$320B+</h2>
<div class="divChild">Total Volume Traded</div>
<div class="divChildBox">
<h2>100+</h2>
<div class="divChild">Countries supported</div>
<div class="divChildBox">
<h2>35M+</h2>
<div class="divChild">Verified users</div>
</div>
</div>
</div>
</div>
</section>
</div>
</body>
</html>