Web platform features explorer

:target-within

This feature is discouraged. Consider using :has() , :target instead. For the rationale, see:

The :target-within CSS pseudo-class matches the element with an ID matching the URL fragment and its ancestors.

Status

Discouraged

Browser support

  • Chrome
  • Chrome Android
  • Edge
  • Firefox
  • Firefox for Android
  • Safari
  • Safari on iOS