πŸš€ LEVEL UP TO SENIOR:Unlock 500+ Advanced Practical Challenges & Exercises.
πŸŽ“ COURSERA PARTNER:Earn professional Google, Meta, and IBM certificates to supercharge your resume.
CSS MASTER CLASS /// VISUAL ENGINEERING /// LAYOUT DESIGN /// ANIMATION LAB /// CSS MASTER CLASS /// VISUAL ENGINEERING ///
⚑ Total XP: 0|πŸ’» css XP: 0

CSS Grid | CSS3 Tutorial

Learn about CSS Grid in this comprehensive CSS3 web design tutorial. Master the grid. Learn the fractional 'fr' unit, discover the power of grid areas, and master the auto-fit and minmax() functions for responsive designs without media queries.

LOADING ENGINE...

Skill Matrix

UNLOCK NODES BY LEARNING NEW TAGS.

2D Layout Engine

CSS Grid Architecture. Harness the ultimate power of the Grid specification to engineer complex, bi-directional, and highly stable web interfaces.


CSS Grid Layout is the most powerful layout system available in CSS. It is a 2D system, meaning it can handle both columns and rows, making it the perfect tool for large-scale page structure and complex component layouts.

1The Fractional Unit (fr)

The fr unit is the heart of Grid. It represents a fraction of the available space. If you have 1fr 2fr 1fr, the container is divided into 4 parts: the middle column takes 2/4 (50%) and the sides take 1/4 (25%) each. Unlike percentages, fr units subtract gaps automatically, meaning you'll never have overflow due to grid spacing.

2Named Areas

One of Grid's best features is grid-template-areas. You can define a visual map of your page using strings.

  • β†’Blueprint: grid-template-areas: 'header header' 'sidebar main';
  • β†’Assignment: On the child element, use grid-area: header;.

This makes your CSS extremely readable and allows you to change your entire page layout for mobile just by reordering the strings in a media query.

Pascual Vila

Pascual Vila

Frontend Instructor // Code Syllabus

Lesson Glossary

[01]display: grid

Activates the 2D grid layout model on an element.

Code Preview
grid container

[02]fr

Fractional unit. Represents a fraction of the available free space.

Code Preview
1fr

[03]grid-template-areas

A visual way to define the layout blueprint using named regions.

Code Preview
named areas

[04]repeat()

A CSS function that allows you to repeat a column/row pattern.

Code Preview
repeat(3, 1fr)

[05]minmax()

Defines a size range greater than or equal to min and less than or equal to max.

Code Preview
minmax(100px, 1fr)

[06]auto-fit

Automatically creates as many grid tracks as can fit in the container.

Code Preview
auto-fit

[07]grid-area

Assigns an item to a specific named region or defined coordinates.

Code Preview
grid-area

Continue Learning