# :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.

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

Level: Journeyman · [More CSS terms at this level](https://www.ask-codey.com/glossary?category=css&level=3)

Updated: November 13, 2026

Source: https://www.ask-codey.com/glossary/focus-within
