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.
Breaking the grid - CSS Tutorial
From the course: CSS: Advanced Layouts with Grid
Breaking the grid
- [Instructor] One of the things I really love about working with CSS grid is it opens up opportunities to do things that we haven't really been able to do before, or things that used to be really difficult to do when it comes to layouts. So let me give you one example of that. Let's say in this three column layout, I want my featured image to span the two last columns. So the featured image spans all the way across to the edge of the screen, and the sidebar falls down below it. Doing this without CSS Grid would require doing some weird stuff with floating this main content next to the sidebar content and wrapping a container around it, but because we're working with CSS Grid, you can just reposition content or make it span bigger areas without really doing much at all. Let me show you how to approach this. So first I'll go into inspect element, and this time I'm not going to go to the layout, instead I'll go to the rules. So let's see, I'll pull this over here, so you can actually…
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 challenge43s
-
Overview of the starting point2m 8s
-
(Locked)
Check for grid support1m 15s
-
(Locked)
Create the main grid3m 19s
-
(Locked)
Position items on the grid2m 16s
-
(Locked)
Add a third column for wider viewports5m 59s
-
(Locked)
Breaking the grid3m 55s
-
(Locked)
Justify the grid inside the grid container2m 30s
-
(Locked)
Use white space to perform magic6m 56s
-
(Locked)
-
-
-
-
-