Kevin Powell | Use this instead of media queries or container queries @KevinPowell | Uploaded February 2024 | Updated October 2024, 2 hours ago.
Media queries are a bit limited in how they work, and while container queries go a really long way in solving a lot of those limitations, there are intrinsic patterns that we can follow that allow us to do things that neither one of them can do.
The setup is a bit strange and can look complex, but, in my opinion, it's also 100% worth it!
π Links
β Why complex CSS is okay: youtu.be/OtqZKLdDNXY
β Finished version, flexbox example: codepen.io/kevinpowell/pen/MWxEjMx
β Finished version, grid example: codepen.io/kevinpowell/pen/abMLmeO
β Timestamps
00:00 - Introduction
01:00 - What we're going to be creating
01:56 - New merch!
02:22 - Changing flexbox layout based on the width of one of its children
09:30 - The grid solution
#css
--
Come hang out with other dev's in my Discord Community
π¬ discord.gg/nTYCvrK
Keep up to date with everything I'm up to
β kevinpowell.co/newsletter
Come hang out with me live every Monday on Twitch!
πΊ twitch.tv/kevinpowellcss
---
Help support my channel
π¨βπ Get a course: kevinpowell.co/courses
π Buy a shirt: teespring.com/stores/making-the-internet-awesome
π Support me on Patreon: patreon.com/kevinpowell
---
My editor: VS Code - code.visualstudio.com
---
I'm on some other places on the internet too!
If you'd like a behind the scenes and previews of what's coming up on my YouTube channel, make sure to follow me on Instagram and Twitter.
Twitter: twitter.com/KevinJPowell
Codepen: codepen.io/kevinpowell
Github: github.com/kevin-powell
---
And whatever you do, don't forget to keep on making your corner of the internet just a little bit more awesome!
Media queries are a bit limited in how they work, and while container queries go a really long way in solving a lot of those limitations, there are intrinsic patterns that we can follow that allow us to do things that neither one of them can do.
The setup is a bit strange and can look complex, but, in my opinion, it's also 100% worth it!
π Links
β Why complex CSS is okay: youtu.be/OtqZKLdDNXY
β Finished version, flexbox example: codepen.io/kevinpowell/pen/MWxEjMx
β Finished version, grid example: codepen.io/kevinpowell/pen/abMLmeO
β Timestamps
00:00 - Introduction
01:00 - What we're going to be creating
01:56 - New merch!
02:22 - Changing flexbox layout based on the width of one of its children
09:30 - The grid solution
#css
--
Come hang out with other dev's in my Discord Community
π¬ discord.gg/nTYCvrK
Keep up to date with everything I'm up to
β kevinpowell.co/newsletter
Come hang out with me live every Monday on Twitch!
πΊ twitch.tv/kevinpowellcss
---
Help support my channel
π¨βπ Get a course: kevinpowell.co/courses
π Buy a shirt: teespring.com/stores/making-the-internet-awesome
π Support me on Patreon: patreon.com/kevinpowell
---
My editor: VS Code - code.visualstudio.com
---
I'm on some other places on the internet too!
If you'd like a behind the scenes and previews of what's coming up on my YouTube channel, make sure to follow me on Instagram and Twitter.
Twitter: twitter.com/KevinJPowell
Codepen: codepen.io/kevinpowell
Github: github.com/kevin-powell
---
And whatever you do, don't forget to keep on making your corner of the internet just a little bit more awesome!