From the course: CSS Essential Training

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

The explicit grid

The explicit grid

- [Instructor] When using the CSS grid layout, the number of grid tracks can be defined with two properties, grid template columns and grid template rows. These properties are declared in the grid container and each value is separated by a space and represents the number of grid tracks. This will create an explicit grid. The grid layout also introduced a new flexible length unit, fr, which represents a fraction of the available space in the grid container. For example, if grid template columns is set to 1fr three times, the grid will split the available space into three columns each with the same width. If the value is set to 1fr, 2fr, 1fr, the grid items will still be arranged into three columns, however, the second track will take up twice the amount of space as the first and third tracks. Values that are repeated can also be defined using the repeat function value. Instead of writing 1fr three times, add the…

Contents