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!
Keep posting like this, Jackie.
Thanks!
thank you. i will
Thanks, v helpful Information.
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
itβs so good θεζ
thank you i will post more like this
Thanks for sharing !!
part 2 incoming β¨
Good Information. I will try these in my code. Thanks!
i will bring more examples soon
very informative
thank you
thank you
you're welcome :)