:focus-within
the
:focus-withincss pseudo-class matches an element if the element or any of its descendants are focused. in other words, it represents an element that is itself matched by the :focus pseudo-class or has a descendant that is matched by:focus. (this includes descendants in shadow trees.)
browser support
| chrome | firefox | safari | |
|---|---|---|---|
| :focus-within | 60 | 52 | 10.1 |
| ::placeholder | 57 | 51 | 10.1 |