CSS: Select elements that contain another selector

CSS4 comes with :has Show archive.org snapshot . E.g. h1:has(b) would select all <h1> tags that contain a <b> tag.

This is implemented in no browser Show archive.org snapshot but the jQuery query engine already supports it Show archive.org snapshot as a custom extension.

Henning Koch Over 8 years ago