From the course: CSS Essential Training
Unlock this course with a free trial
Join today to access over 25,600 courses taught by industry experts.
The explicit grid
From the course: CSS Essential Training
The explicit grid
- [Instructor] In grid layouts, two properties are used to define a fixed number of grid tracks to form an explicit grid, grid-template-rows and grid-template-columns. These properties are declared in the grid-container, and each value adds and defines the size of a row or column. They can be used with standard length and percentage values, but there are also grid-specific values that were introduced with this layout module. Grid can also be used with the fr unit, which represents a fraction of the available space in the grid container. Here's how it works. If grid-template-columns is set to 1fr three times, the grid will create three equal columns. If the second value is set to 2fr, it will still create three columns, but the middle track takes up twice as much space. Repeated values can also be set with the repeat function. Specify the number of tracks in the parentheses, followed by a comma and the track size. Let's…
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)
Introduction to CSS Grid2m 49s
-
(Locked)
The explicit grid3m 35s
-
(Locked)
The implicit grid2m 16s
-
(Locked)
The gap property54s
-
(Locked)
Positioning with grid lines3m 31s
-
(Locked)
Project: Grid layout4m 36s
-
(Locked)
Project: Grid line positioning7m 25s
-
(Locked)
Project: Grid and dev tools2m 44s
-
(Locked)
-
-
-
-