#
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.
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
A Deep Dive into StyleX
Frontendmasters ·
Sep 10, 2026
CSS
css-in-js
Feature Detecting “Undetectable” CSS Features with @supports named-feature()
Original Content – Bram.us ·
Aug 27, 2026
CSS
feature detection
A deep dive into StyleX
Flaviocopes ·
Aug 27, 2026
StyleX
Javascript
On the suggested CSS Universal Class Selector `*-`
XML-RSS Feed for Anselm Hannemann’s Writings ·
Aug 21, 2026
CSS
Web Development
CSS Infinity Use Cases
Nerdy ·
Jul 25, 2026
CSS
Blog
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
.