#
DIFF.BLOG
New
Following
Discover
Jobs
More
Top Writers
Suggest a blog
Upvotes plugin
Report bug
Contact
About
Privacy
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.
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
Fallbacks for CSS `progress()`
Frontendmasters ·
Oct 2, 2026
blog-post
clamp
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
On the suggested CSS Universal Class Selector `*-`
XML-RSS Feed for Anselm Hannemann’s Writings ·
Aug 21, 2026
Web Development
CSS
Discover more posts →
AUTHOR
Advertise
Sponsor diff.blog
Put your product in front of developers who read and write about their craft. One exclusive sponsor at a time.
Become a sponsor →
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
.