<?xml version="1.0" encoding="utf-8"?>

CSS display property with the grid value

CSS display property with the grid value Bad Practice
CSS display property with the grid value Best Practice

Like the flexbox, the grid is a layout module that allows you to align elements on a page. The crucial difference between flexbox and grid is that flexbox structures the layout in only one dimension — either a row or a column. The ideal use case for the flexbox is having several items that you want to space out evenly in a container either horizontally or vertically.

When you use the grid layout, you first create a layout and then put items into rows and columns. In other words, the grid properties work to help web designers create a high-level structure of a page.

Like the flexbox, the display:grid; declaration consists of a parent element and its child elements.

Top contributors

Reyhan Yarim

Topics

From Lesson

Share

Improve your UX & Product skills with interactive courses that actually work