Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

A CSS Trick to Select a Specific Row with Grid Auto-fit/fill

Kevin Powell via YouTube

Overview

Coursera Flash Sale
40% Off Coursera Plus for 3 Months!
Grab it
Learn an advanced CSS technique for targeting specific rows in CSS Grid layouts that use auto-fit or auto-fill properties. Master the use of container queries and CSS selectors to precisely control styling for first rows, last rows, second rows only, or first two rows in responsive grid systems. Explore the requirements and setup needed for this technique to work effectively, including how to implement container queries for different row selections. Discover alternative approaches using newer CSS features that eliminate the need for container queries entirely. Practice with provided CodePen examples demonstrating each variation of the technique, and understand the underlying principles that make this advanced grid manipulation possible.

Syllabus

00:00 - Introduction
00:45 - Requirements for this to work
01:45 - Setting up the first container query
03:00 - Getting the first two rows
05:10 - Getting only the second row
07:00 - Selecting the last row
13:44 - Using new CSS features so we don’t need container queries

Taught by

Kevin Powell

Reviews

Start your review of A CSS Trick to Select a Specific Row with Grid Auto-fit/fill

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.