Today I came across the a new CSS pseudo class that will be very handy for web developers who are styling focus states.
:focus-within pseudo class becomes active when an element itself has focus or if any of its descendants does.
Take for example the following HTML code:
and the following CSS:
We're happy to share this resource that we found. The content displayed on this page is property of it's original author and/or their organization.