:focus-within

Styles an element when it, or anything inside it, has keyboard focus.

What does :focus-within do?

:focus-within matches an element while it or anything inside it has focus, such as a link someone has tabbed to. It lets a parent react to the keyboard: a menu that opens on hover can open for keyboard users too.

.find:hover .find-menu,
.find:focus-within .find-menu { display: block; }

Level: Journeyman · More CSS terms at this level

Updated