Grid Column Fractional Units
With CSS Grid Layout, there's a flexible unit - "fr". Fr is a fractional unit so an item with a width of 1fr takes up 1 part of the available space.
This widget has three columns and the default setting is 1fr for each column. Three images with different aspect ratios are inserted. If the width of each was 1 fractional unit, the layout would look like the example below.
In the item above, the square image and the portrait image are each inserted in a column which is 1fr. The landscape image column is 1.5fr which creates a better balance.
In both examples, the images are vertically aligned in the center. They can also be aligned so that the images are aligned at the top or the bottom of the container as described further down this page.