1:50:44A CSS Trick to select a specific row with Grid auto-fit/fill
From the creator
Looking to step up your CSS Game? Check out https://cssdemystified.com π Links β Code for last row only: https://codepen.io/kevinpowell/pen/ogjwxyv/19639a71b6ff26e1bf87738fa6db12d5 β Code for first two rows only: https://codepen.io/kevinpowell/pen/vENZGvG/14a4bdacb2fa79bbdd9cd1e400b57097 β Code for 2nd row only: https://codepen.io/kevinpowell/pen/YPyQqMq/990300b888e8aec0d77d520d5948ddb5 β Keithβs article: https://keithclark.co.uk/articles/targeting-first-and-last-rows-in-css-grid-layouts/ β Temaniβs version with no container queries: https://codepen.io/t_afif/pen/QwbZKPB?editors=1100 β Keep up to date with everything I'm up to https://www.kevinpowell.co/newsletter π¬ Come hang out with other devs in my Discord Community https://discord.gg/nTYCvrK β Are you a beginner? HTML & CSS for absolute beginners is for you: https://learn.kevinpowell.co π Start writing CSS with confidence with CSS Demystified: [https://cssdemystified.com](https://cssdemystified.com/) π Already mastered CSS? Check out my advanced course, Beyond CSS: https://www.beyondcss.dev/ β Timestamps 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 #css --- Help support my channel π¨βπ Get a course: https://www.kevinpowell.co/courses π Buy a shirt: https://cottonbureau.com/people/kevin-powel
Published 2025-08-13 Β· Watch on YouTube β
Availability and playback restrictions are controlled by the original channel.





