#
DIFF.BLOG
New
Following
Discover
Jobs
More
Top Writers
Suggest a blog
Upvotes plugin
Report bug
Contact
About
Sign up
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.
CSS
Web Development
Design techniques
Frontend Development
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
News
articles
Modern CSS colors: oklch() and color-mix()
Flaviocopes ·
Aug 23, 2026
CSS
Web Development
The Future of CSS: Target Multiple Classes with the Class Prefix Selector
Original Content – Bram.us ·
Aug 19, 2026
CSS
selectors
On the suggested CSS Universal Class Selector `*-`
XML-RSS Feed for Anselm Hannemann’s Writings ·
Aug 21, 2026
CSS
Web Development
Ending Responsive Images
Frontendmasters ·
Jul 31, 2026
HTML
images
CSS Infinity Use Cases
Nerdy ·
Jul 25, 2026
CSS
Blog
Discover more posts →
AUTHOR
RECENT POSTS FROM THE AUTHOR
Choose how you want to continue.
Continue with GitHub
Continue with Google