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 (14)
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
Thanks, v helpful Information.
it‘s so good 聚合搜
Keep posting like this, Jackie.
Thanks!
part 2 incoming ✨
Thanks for sharing !!
very informative
thank you
Good Information. I will try these in my code. Thanks!
i will bring more examples soon
thank you
you're welcome :)