Enable smooth, controlled scrolling by "snapping" elements into view on scroll.
Keeps elements like images responsive while maintaining their aspect ratio.
Creates a new stacking context, helping with layer control in complex layouts.
Resets all styles on an element, great for predictable component design.
Styles multiple selectors without adding specificity, ideal for reusable styles.
Top comments (16)
Great article! For those looking for more tips, I wrote a similar article with modern CSS tricks: Modern CSS Tips & Tricks. Keep up the good work!
Iβve always wanted to use the
:where
selector, and this gave me a nice use-case. Thanks!Honestly I used it maybe once or twice in real case scenario. It's very niche
Keep posting like this, Jackie.
Thanks!
thank you. i will
Thanks, v helpful Information.
itβs so good θεζ
thank you i will post more like this
very informative
thank you
Good Information. I will try these in my code. Thanks!
i will bring more examples soon
part 2 incoming β¨
Thanks for sharing !!
thank you
you're welcome :)