I am trying to create a grid layout using CSS grid:
The main section should have two columns. The first column will contain an image that sticks to the bottom of the grid, while the second column will display a centered card.
Below are my HTML/CSS codes:
.mainbody {
display: grid;
grid-template-columns: 1fr 1fr;
grid-template-rows: repeat(1, 2fr);
text-align: center;
grid-gap: 5px;
padding-top: 75px;
}
.left {
float: left;
overflow: hidden;
height: 600px;
position: relative;
}
.left-bottom {
position: absolute;
bottom: 0px;
}
.right {
float: left;
width: 50%;
overflow: hidden;
}
<div class="container mainbody">
<div class="left">
<div class="left-bottom">
<img class="image-car" src="...">
</div>
</div>
<div class="container">
<div class="card">
//card text
</div>
</div>
</div>
While this code works well, it does not respond to media queries. As a beginner, I would appreciate any suggestions on how to modify this code or approach to achieve the desired outcome.