From the course: CSS: Advanced Layouts with Grid
Unlock the full course today
Join today to access over 23,200 courses taught by industry experts.
Create a grid for each card - CSS Tutorial
From the course: CSS: Advanced Layouts with Grid
Create a grid for each card
- Let's start with the individual cards. Here I want the month and date to appear on the left-hand side, as if they were inside a box. And then the title and meta-description to appear on the right-hand side, one after the other. And I want all of this to center align vertically to make it all nice and tidy. Before grid, the only way we could do this was by floating the month and date to the left, so encasing that in a container, then encasing the title and meta-description in another container, and floating that to the right and then we'd use padding and margin and everything to get it to align. With grid, we approach this problem very differently. Instead we make each card a grid, and then we define it, two columns and two rows inside that grid, and place the items on the grid. So the month and date are placed in the first column, and the two rows, then the title is placed in the second column on the first row, and the meta-description is placed in the second column on the second…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
(Locked)
The challenge48s
-
(Locked)
Overview of text-based card markup2m 10s
-
(Locked)
Create a grid for each card2m 21s
-
(Locked)
Position items on the grid4m 20s
-
(Locked)
Place the cards on a grid5m 17s
-
(Locked)
Overview of image-based card markup2m 21s
-
(Locked)
Using the grid to stack grid items2m 18s
-
(Locked)
Change the appearance of cards with flex5m 43s
-
(Locked)
Create different-sized grid items2m 10s
-
(Locked)
Create a complex magazine-style grid8m 43s
-
(Locked)
-
-
-