Create a Responsive Image Grid Using CSS Flexbox without Using Media Queries

Share this video with your friends

Send Tweet

Learn how to build a grid of images using flexbox and the flex-wrap property.

Flexbox allows us to build one-dimensional layouts where we have control over how we're going to display items.

Items can be laid out horizontally (row) or vertically (column) inside a flex container. The default behavior for a flex container is to lay items in a single row.

Adding flex-wrap: wrap to the flex container will allow the items to wrap onto multiple lines depending on the available width.