Kevin Powell | 2 better alternatives to overflow: hidden @KevinPowell | Uploaded December 2023 | Updated October 2024, 1 hour ago.
Looking to up your CSS Game? Free & Premium courses π kevinpowell.co/courses?utm_campaign=general&utm_source=youtube&utm_medium=nomorehidden
Overflow hidden is one of those features that seems like it should work in a very specific way, but it comes with a few strange side effects that can be incredibly frustrating and hard to fix.
The powers who be have realized that there should probably be a better solution, and we have one with `overflow: clip`, which is basically a better version of `overflow: hidden`. I honestly donβt know if we need to bother with hidden at all anymore.
Depending on the use case, we might want to use `contain: paint` instead though, which comes with some extra limitations, but also potential improvements to performance.
π Links
β Polypane: https://polypane.app/?ref=kevin (this is an affiliate link, so if you do purchase after visiting through this link, it would also help support my channel)
β Killianβs article on overflow: clip: kilianvalkhof.com/2022/css-html/do-you-know-about-overflow-clip
β Browser support for clip: caniuse.com/mdn-css_types_overflow_clip
β Browser support for contain: paint: caniuse.com/mdn-css_types_overflow_clip
β My CSS-only parallax video: youtu.be/Qj0Qx8HpNUo
β My courses: kevinpowell.co/courses?utm_campaign=general&utm_source=youtube&utm_medium=nomorehidden
β Timestamps
00:00 - Introduction
00:10 - The problems overflow: hidden can cause
01:15 - Target whatβs causing the overflow first
04:40 - overflow: clip
06:20 - overflow-clip-margin
07:52 - courses!
08:20 - contain: paint
#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!
Looking to up your CSS Game? Free & Premium courses π kevinpowell.co/courses?utm_campaign=general&utm_source=youtube&utm_medium=nomorehidden
Overflow hidden is one of those features that seems like it should work in a very specific way, but it comes with a few strange side effects that can be incredibly frustrating and hard to fix.
The powers who be have realized that there should probably be a better solution, and we have one with `overflow: clip`, which is basically a better version of `overflow: hidden`. I honestly donβt know if we need to bother with hidden at all anymore.
Depending on the use case, we might want to use `contain: paint` instead though, which comes with some extra limitations, but also potential improvements to performance.
π Links
β Polypane: https://polypane.app/?ref=kevin (this is an affiliate link, so if you do purchase after visiting through this link, it would also help support my channel)
β Killianβs article on overflow: clip: kilianvalkhof.com/2022/css-html/do-you-know-about-overflow-clip
β Browser support for clip: caniuse.com/mdn-css_types_overflow_clip
β Browser support for contain: paint: caniuse.com/mdn-css_types_overflow_clip
β My CSS-only parallax video: youtu.be/Qj0Qx8HpNUo
β My courses: kevinpowell.co/courses?utm_campaign=general&utm_source=youtube&utm_medium=nomorehidden
β Timestamps
00:00 - Introduction
00:10 - The problems overflow: hidden can cause
01:15 - Target whatβs causing the overflow first
04:40 - overflow: clip
06:20 - overflow-clip-margin
07:52 - courses!
08:20 - contain: paint
#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!