:focus-within

the :focus-within css 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.)

#1
#2

browser support

chromefirefoxsafari
:focus-within605210.1
::placeholder575110.1
back to home