spring flowers
black dog smiling in the sun
Maggie loves being outside off-leash.
Using :has() can be easy.

figure:has(pre) {
  background: rgb(252, 232, 255);
  border: 3px solid white;
  padding: 1rem;
}
This demo requires a browser that supports :has().