Blogs

Select an Element with a Non-Empty Attribute

Css Tricks

Short answer: [data-foo]:not([data-foo=""]) { } Longer answer (same conclusion, just an explanation on why we might need this): Say you have an element that you style with a special data-attribute: You want to target that element and do special things when highlighting.

Visit Site

Select an Element with a Non-Empty Attribute
Unsuck It | CSS-TricksCss Tricks Responsive Iframes | CSS-TricksCss Tricks Finally... A Post on Finally in Promises | CSS-TricksCss Tricks Weekly news: Truncating muti-line text, calc() in custom property values, Contextual AlternatesCss Tricks What the Web Needs Now (and how ARTIFACT is here for it)Css Tricks What I Like About VueCss Tricks Some Things You Oughta Know When Working with Viewport UnitsCss Tricks Using Web AnalyticsVercel Detect Non-Inclusive Language with Retext and Node.js - Deepgram Blog ⚡️Deepgram Accessible name - GlossaryDeveloper Mozilla Time to Interactive (TTI) - GlossaryDeveloper Mozilla Vary This, Vary That - Introducing New Custom Query Parameter Vary Cache SettingsBunny Launch Week III Day 3: Web Editor BranchingMintlify Did You Know the Ordered List Element Has Start and Reversed Attributes?Css Tricks Just Enough SQL to Safely Use AI for Data AnalysisMotherduck Intrinsic size - GlossaryDeveloper Mozilla blink element ( tag) - GlossaryDeveloper Mozilla Wildcard CDN Cache Purging Is Here!Bunny Update nameservers for a domain | Vercel SDKVercel Oh Hey, Padding Percentage is Based on the Parent Element's WidthCss Tricks