CSS :has() Examples

Select all siblings of a given element.

In this example, if a card is being hovered, we change the style of all card elements that are not being hovered.

.cards:has(.card:hover) .card:not(:hover) {
  opacity: 0.2;
}
One
Two
Three
Four
Five