« Previous Demo: Sticky Captions Concept Back to the Codrops Article

CSS Click Events :focus way

The :focus way

Clicking below will trigger the :focus on the element, resulting in turning every element after it red with the .to-be-changed class.

Clicking anywhere else on the screen will lose the focus on the element, restoring the default state of the .to-be-changed elements.


Click me!

I’m going to be red! It’s gonna be legen... Wait for it...