Is there a CSS parent selector? Yes: :has()
Modern CSS has :has():
a:has(img) { border: 1px solid; }This selects links that contain an image. Check the browser compatibility table on MDN before depending on it for older browsers.
Modern CSS has :has():
a:has(img) { border: 1px solid; }This selects links that contain an image. Check the browser compatibility table on MDN before depending on it for older browsers.