From the course: CSS: Combining Grid and Flexbox

Unlock the full course today

Join today to access over 24,700 courses taught by industry experts.

How does Grid work?

How does Grid work?

- [Instructor] Let's talk briefly about how grid works. A grid is a set of intersecting horizontal and vertical lines that create columns and rows. Elements can be placed into the grid and they can exist within those lines. In essence, they will take up the space that's in the columns and the rows. Once you establish an HTML element that has displayed grid on it, it becomes the grid container. You can think of this as the parent element, and it's going to hold all of the grid children or the grid items. One of the most powerful features of CSS grid is you'll not have to add a bunch of extra containers and boxes, no extra HTML, in order to achieve the layout that you want. Since it works in two dimensions, you will not need to create so many extra nested elements. You'll end up with clean semantic markup and nothing else. As of March, 2017, most browsers natively supported unprefixed CSS Grid. These include Chrome…

Contents