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 different-sized grid items - CSS Tutorial
From the course: CSS: Advanced Layouts with Grid
Create different-sized grid items
- Let me show you one more thing before we move on to the next example. Looking at this layout we have right now I'm sure you're thinking this is cool and all but it's starting to look really boring especially when we start lightening the view port. This is about as rigid of a grid as you can get and hardly inspirational unless you're making some sort of image gallery. If you want something a little more dynamic right, the images have different sizes, and different things happen. Well using CSS Grid that's actually pretty straight forward. If I go into my style sheet and then find the media query for this wide area where we have four columns, I can create a new rule, call it double, and then inside the rule I'll say grid, column, span two, and grid row, span two. That means any element that has double class appended to it will now span two columns and two rows. And I of course have to apply that to one of these elements. So I'll go in here and maybe add it to the first one. So I'll…
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)
-
-
-