DIFF.BLOG
New Following Discover Jobs
More
Top Writers Suggest a blog Upvotes plugin
Report bug Contact About Privacy
Sign up
Topics
Follow your own topics →
Menu
New Following Discover Jobs Top Writers
More
Suggest a blog Upvotes plugin Report bug Contact About
Sign up
Privacy Policy
The home for great developer writing.
We surface the best developer writing from thousands of independent blogs, updated daily.
Join Diff.blog
TOPICS

How to apply CSS only if there are a certain number of nested elements

· Gomakethings · Aug. 22, 2026, 4:40 p.m.
Web Development CSS Frontend Development Design techniques
Summary
This blog post discusses a creative CSS technique for applying styles based on the number of nested elements in a list without using JavaScript, leveraging the :has() pseudo-class and other CSS selectors.
Read full post on gomakethings.com →
MORE POSTS LIKE THIS
What’s !important #15: Boundary-aware CSS, Time-based CSS, Full-bleed CSS, and More
CSS-Tricks · Jul 15, 2026
articles News
Useful @custom-media Presets
Frontendmasters · Oct 29, 2026
blog-post @custom-media
Seokho Song: Custom Highlight Universal Selector ::highlight(*)
Blogs Igalia · Oct 20, 2026
Web Development CSS
Make your website printable - a short guide
Juha-Matti Santala · Sep 23, 2026
Web Development CSS
12 CSS features you can use today with no build step
Flaviocopes · Sep 21, 2026
Web Development CSS
Feature Detecting “Undetectable” CSS Features with @supports named-feature()
Original Content – Bram.us · Aug 27, 2026
Original Content CSS
Discover more posts →
AUTHOR
RECENT POSTS FROM THE AUTHOR
Choose how you want to continue.
Continue with GitHub Continue with Google
By continuing, you agree to our Privacy Policy.