
Responsive preview card component using flexbox and grid
Design comparison
Solution retrospective
In a column layout it is very easy to manage the size of an image while making a responsive design. We can give a specific width to the container (which contains the image) and make the image's width 100% of the container width and use properties like 'object-fit' , 'object-position' , 'background-size' , etc to make the image responsive.
But, what happens when we are dealing with height of an image in a row-based layout (i.e. in mobile layout) ?
- Either in flexbox, when flex-direction is set to column.
- Or in GRID based layout.
How do we now make an image responsive now ? It would very helpful if someone could give a very simple explaination. If the explaination seems to be long , you can also point me to a article on the internet.
Community feedback
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord