:has() Playground - Free Online CSS Tool | IconVault
Experiment with the CSS :has() relational selector in interactive demos. Style parents based on children. Free, runs in your browser.
:has() Playground
Try the CSS parent selector live
1. Card with an image
Invalid selectorStyle a card differently when it contains an image, no extra class needed on the card.
Card with image
Matches :has(img)
Card without image
No match, no highlight
2. Form validation state
Invalid selectorReact to a child's state from the parent: highlight the whole form while any field is invalid. Type a bad email to see it.
3. Nav with an active link
Invalid selectorGive the nav bar a distinct look only when one of its links is active. Click the links to toggle.
4. Grid with a featured item
Invalid selectorChange the whole grid layout when it contains a featured item, without JavaScript.
5 of 5 free snippet copies left.
About this tool
IconVault's :has() Playground is an interactive lab for the CSS relational pseudo-class :has(): try the famous parent selector with live demos, including styling a parent based on its children and matching siblings. Edit the samples, toggle states and see the selector logic work instantly.
:has() ended decades of asking for a parent selector in CSS: card:has(img), form:has(:invalid), nav:has(.active). It ships in all modern browsers. Free and runs fully in your browser.
Frequently asked questions
Popular searches
More tools
Code Playground
Write HTML, CSS & JS with live preview.
JSON Formatter
Beautify, validate & minify JSON.
Base64 Encoder
Encode & decode text and files.
JWT Decoder
Inspect tokens without sending them anywhere.
Coming soon
CLI
Coming soon
Figma plugin
Coming soon
VS Code extension
Coming soon
Chrome extension
Coming soon
AI icon generator
Coming soon
Team workspaces
Coming soon