The : has() pseudo-class | Css

 .card:has(.card-link) {
  background-color: red;
} 

AI Explanation

This CSS code targets elements with the class "card" that contain at least one element with the class "card-link". Once this condition is met, it applies a background color of red to the element with the class "card". In simpler terms, this code styles elements with the class "card" only if they also have a child element with the class "card-link".