Image Gallery Different Sizes. You don t care if they are resized but they should maintain their aspect ratio. Let s say you have a bunch of images you want to display and the goal is to get them edge to edge on the browser window with no gaps.

It s important to know that flexbox does have issues with keeping aspect ratio when images have different widths and heights. Above is a gallery of images with images of varying width and height which is a perfect use case for css grids. Image galleries made by websites like unsplash pinterest etc are made by techniques like positioning or translating the image item which is a very cumbersome task to do.
111236038 many lamps of the same size in different colors.
However note that this flexbox image gallery is only a good choice if all images have the same size. Above is a gallery of images with images of varying width and height which is a perfect use case for css grids. How to use css media queries to create a responsive image gallery that will look good on desktops tablets and smart phones. Same size stock photos and images 712 matches.