<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/did-you-know-about-the-has-css-selector--ofhtvtru9" -->

---
title: Did You Know About the :has CSS Selector? | daily.dev
description: The :has CSS selector is going to have a big impact on how we write CSS in the future. In fact, if it ever ships in browsers, I think it breaks my mental model...
canonical: https://daily.dev/posts/did-you-know-about-the-has-css-selector--ofhtvtru9
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Did You Know About the :has CSS Selector? | daily.dev
og:description: The :has CSS selector is going to have a big impact on how we write CSS in the future. In fact, if it ever ships in browsers, I think it breaks my mental model...
og:url: https://daily.dev/posts/did-you-know-about-the-has-css-selector--ofhtvtru9
og:image: https://api.daily.dev/og/posts/OFhtVtRu9.png
og:image:alt: Did You Know About the :has CSS Selector?
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Did You Know About the :has CSS Selector?

**[CSS-Tricks](https://daily.dev/sources/css_tricks)** · 2 min read · 40 upvotes · 4 comments

## Summary

The :has CSS selector is going to have a big impact on how we write CSS in the future. In fact, if it ever ships in browsers, I think it breaks my mental model for how CSS fundamentally works because it would be the first example of a parent selector in CSS. :has isn’t supported in browsers right now (probably for those performance reasons), it is part of the CSS Selectors Level 4 specification.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://css-tricks.com/did-you-know-about-the-has-css-selector/>

## Community discussion

Top comments from developers on daily.dev.

**@eo4wellness192** · 2 upvotes

> Interesting, quick read, of what MAY be coming to CSS.

**@rezilo** · 2 upvotes

> Probably when there is more widespread browser support there will be where to use this

**@dshung1997** · 1 upvotes

> Nice. I had the same feeling that it broke my mental sense of how CSS styles work HAHA

## Similar posts on daily.dev

- [Don’t just attend KubeCon \+ CloudNativeCon, Merge Forward your experience\!](https://daily.dev/posts/don-t-just-attend-kubecon-cloudnativecon-merge-forward-your-experience--l0rpp73x8) · CNCF · 1 upvotes · 0 comments
- [Announcing H2 2026 KCDs](https://daily.dev/posts/announcing-h2-2026-kcds-m96goajm1) · CNCF · 1 upvotes · 0 comments
- [Two months of Open Community Groups](https://daily.dev/posts/two-months-of-open-community-groups-asf52zhbs) · CNCF · 0 upvotes · 0 comments
- [CNCF Unveils Schedule for KubeCon \+ CloudNativeCon Europe 2026](https://daily.dev/posts/cncf-unveils-schedule-for-kubecon-cloudnativecon-europe-2026-ikhcoa5cb) · CNCF · 2 upvotes · 0 comments
- [CNCF Debuts KubeCon \+ CloudNativeCon Japan 2026 Schedule](https://daily.dev/posts/cncf-debuts-kubecon-cloudnativecon-japan-2026-schedule-xp5pyudub) · CNCF · 1 upvotes · 0 comments

---

Tags: [#webdev](https://daily.dev/tags/webdev), [#css](https://daily.dev/tags/css)

[View this post on daily.dev](https://daily.dev/posts/did-you-know-about-the-has-css-selector--ofhtvtru9)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Did You Know About the :has CSS Selector?","url":"https://daily.dev/posts/did-you-know-about-the-has-css-selector--ofhtvtru9","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/did-you-know-about-the-has-css-selector--ofhtvtru9"},"datePublished":"2021-03-17T19:06:20.490Z","dateModified":"2021-10-07T14:17:10.317Z","description":"The :has CSS selector is going to have a big impact on how we write CSS in the future. In fact, if it ever ships in browsers, I think it breaks my mental model...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/4038384dc18dd7b237906ad889689ce0","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/4038384dc18dd7b237906ad889689ce0","isAccessibleForFree":true,"articleSection":"CSS-Tricks","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"CSS-Tricks","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/css_tricks","url":"https://daily.dev/sources/css_tricks"},"commentCount":4,"discussionUrl":"https://daily.dev/posts/did-you-know-about-the-has-css-selector--ofhtvtru9","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":40},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":4}],"keywords":"webdev,css","timeRequired":"PT2M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"CSS-Tricks","item":"https://daily.dev/sources/css_tricks"},{"@type":"ListItem","position":3,"name":"Did You Know About the :has CSS Selector?"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/did-you-know-about-the-has-css-selector--ofhtvtru9","comment":[{"@type":"Comment","text":"Interesting, quick read, of what MAY be coming to CSS.","datePublished":"2021-03-17T20:34:02.803Z","url":"https://daily.dev/posts/OFhtVtRu9#c-ntkn9Ilhj","author":{"@type":"Person","name":"EO4Wellness","url":"https://daily.dev/eo4wellness192","image":"https://avatars.githubusercontent.com/u/55713583?v=4"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2}},{"@type":"Comment","text":"Probably when there is more widespread browser support there will be where to use this","datePublished":"2021-03-20T07:21:29.199Z","url":"https://daily.dev/posts/OFhtVtRu9#c-UlItys2Mn","author":{"@type":"Person","name":"Ilya Rezanov","url":"https://daily.dev/rezilo","image":"https://avatars.githubusercontent.com/u/62277472?v=4"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2}},{"@type":"Comment","text":"Nice. I had the same feeling that it broke my mental sense of how CSS styles work HAHA","datePublished":"2021-03-23T15:38:53.932Z","url":"https://daily.dev/posts/OFhtVtRu9#c-4897_1J-M","author":{"@type":"Person","name":"Sy-Hung Doan","url":"https://daily.dev/dshung1997","image":"https://avatars2.githubusercontent.com/u/19758667?v=4"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}}]}
```

