@iprinceroyy
Posted
Hey @victorebegbuna, You did a good job. But this solution is not robust. I would suggest another approach which is easy:
- You should first create one main container for the four cards.
- Set the display property for the container to flex in mobile view.
Like this
.container{ display: flex; flex-direction: column; }
- For desktop view, use the @media query & change the display property.
@media (min-width:992px){ .container{ display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr); } }
You can see this approach in my solution. I've done it. I hope it adds to your learning, happing coding :)
Marked as helpful