From the course: CSS: Variables and Fluid Layouts
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Rewrite CSS to integrate gaps between grid cells - CSS Tutorial
From the course: CSS: Variables and Fluid Layouts
Rewrite CSS to integrate gaps between grid cells
- [Instructor] Now that we have the initial layout scoped for our prototype and it's working, everything is good, now we need to add that gap in between each cell, so let's just start to think about this particular problem. We have a number here called columns. That's how many columns we have in our layout. We know there's four columns, four columns all the time, and each one of these cells that we're looking at here, we give them a width, which is how many columns they occupy, so each of the widths here is one column. These are two columns and so forth. Now, lets think about the gaps. Well, in a row like this where I have four cells, how many gaps do I have? Remember we're using the justify content of space between, so we shove the first cell all the way to the left, the last cell all the way to the right, we distribute the space evenly in between. How many gaps do we have? Well, in a row of four like that, we have three…
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)
Mark up a simple four-column grid system6m 48s
-
(Locked)
Create a starting CSS for the grid system7m 1s
-
(Locked)
Add media queries to your grid system11m 39s
-
(Locked)
Rewrite CSS to integrate calc() and custom properties7m 53s
-
(Locked)
Rewrite CSS to integrate gaps between grid cells4m 35s
-
(Locked)
Make the layout formula even more flexible9m 26s
-
(Locked)
Challenge: Media query integration1m 24s
-
(Locked)
Solution: Media query integration1m 59s
-
(Locked)
-
-