---
title: "How to use the CSS :has Selector"
url: https://daily.dev/posts/how-to-use-the-css-has-selector-tgeas22wh
source_url: https://blog.openreplay.com/how-to-use-the-css-has-selector/
type: article
source: "asayer"
published: 2023-09-08T01:18:05.881Z
updated: 2023-09-08T01:17:50.195Z
tags: ["github", "css"]
reading_time: 6
upvotes: 31
comments: 0
language: 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.

# How to use the CSS :has Selector

**[asayer](https://daily.dev/sources/asayer)** · 6 min read · 31 upvotes · 0 comments

## Summary

The selector is a CSS pseudo-class that allows you to select an element if it contains child elements. Using the selector, you can apply styles to a parent or ancestor HTML element. This allows us to extend the selector’s scope to include one or multiple siblings or children.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://blog.openreplay.com/how-to-use-the-css-has-selector/>

## 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 · 0 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

---

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

[View this post on daily.dev](https://daily.dev/posts/how-to-use-the-css-has-selector-tgeas22wh)
