DEV Community

Rajesh Dhiman
Rajesh Dhiman

Posted on • Originally published at rajeshdhiman.in on

4 1

Today I learned :focus-within

Today I learned that there exists a CSS pseudo-class called :focus-within which we can use to match an element if the element itself or any of its descendants are matched by :focus.

It is very helpful in cases when you want to highlight a container which also have few child elements and you want to keep it highlighted even if any of child elements is currently in focus.

for more details and syntax, please check MDN.

The post Today I learned :focus-within appeared first on Rajesh Dhiman.

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay