I am trying to format my page with a title in h4, a sub-title in h5, and 3 divs arranged like the image shown here:
https://i.sstatic.net/29EJV.png
This is my current HTML code:
<!DOCTYPE html>
<html>
<head>
<style>
.grid-container {
display: grid;
column-gap: 50px;
grid-template-columns: auto auto auto;
background-color: #2196F3;
padding: 10px;
}
.grid-item {
background-color: rgba(255, 255, 255, 0.8);
border: 1px solid rgba(0, 0, 0, 0.8);
padding: 20px;
font-size: 30px;
text-align: center;
}
</style>
</head>
<body>
<div class="grid-container">
<h4>Title 1</h4>
<h5>SubTitle 1</h5>
<div class="grid-item">1</div>
<div class="grid-item">2</div>
<div class="grid-item">3</div>
</div>
</body>
</html>
However, I am facing an issue where my divs are shifted to the right and the titles are not aligned correctly as shown in this image: https://i.sstatic.net/E3lgP.png
Does anyone have any suggestions on how to fix this alignment issue?
Would combining Bootstrap 4 help align my titles and divs properly, or can it be achieved using only the grids?