CSS
Auto GridA grid layout using the min-max function and the auto-fill keyword to create a responsive grid without using media queries.
A grid layout using the min-max function and the auto-fill keyword to create a responsive grid without using media queries.
Items in the grid can be spaced out evenly giving a value to the grid-gap property.
The grid-column-gap and grid-row gap properties can be used if the columns and rows need different spacing.
Grid items are aligned vertically using the align-items property, The default value is "auto" which makes all the grid item heights equal despite varying content.
Grid items are aligned horizontally using the justify-items property.
Grid is a lot more versatile than flex but there are situations where it can be combined with grid.
The links are positioned at the bottom of the grid item very simply by using flex and auto margins.
The CSS Grid Layout Module has made all these responsive grid layout like Bootstrap redundant. The module can create grids with just a few lines of CSS and no Javascript.
The auto grid is even more efficient in that it can change the number of items per row based on browser/device screen width without having to use media queries.
It's only necessary to set a minimum width for the grid items and, combined with the auto-fill keyword, everything just works!
Content Grid
The grid shown here has images with alt text, a heading, an optional span, text and an optional link It can have up to 48 items.
The grid rows maintain equal height despite varying content and the links line up at the bottom.
Links
The links can open internal or external pages and have a new window option. They can be styled as standard links, CTA links with a solid background or CTA links with a border.