I started with 3 elements and thought about making them adaptive by using css grid.
<div class="elements-wrapper">
<div class="element-1"></div>
<div class="element-2"></div>
<div class="element-2"></div>
</div>
Can you provide the CSS code for this layout?
.elements-wrapper{
position: relative;
clear: both;
display: grid;
grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
grid-gap: 60px;
margin-bottom: 10%;
}
It's working well, but on smaller screens (around 1200px) the third element moves to the bottom and aligns to the edge. I want it to be centered. What modifications are needed?
| element1 | | element2 | or | element1 | | element2 |
| element3 | | element3 |
I'd like the elements to be centered like this:
| element1 | | element 2 |
|element 3 |