New Jul 27, 2026

Chris’ Corner: Click Something Do Something

Company/Startup Blogs All from CodePen View Chris’ Corner: Click Something Do Something on blog.codepen.io

Maybe I’m just old (coughs dust), but if you can make a click do something in HTML and CSS alone, it always feels cool and fancy to me. Even just “click to go to another page”, the foundation of the web, is cool and fancy. And if it happens to go to a same-domain URL, you can animate it, which so happens to be the subject of our CodePen Challenge this past week.

Perhaps the first “trick” for click-something-do-something in HTML+CSS was The Checkbox Hack, where we could style based on the input:checked ~ .something-else style selector. With this tiny bit of interactive state, people built incredible things.

But a lot has changed since then. Even just <details> came along and gave us an open/closed state with a click, which you can also select off of in CSS.

Heck, we can use an “invoker” to open a dang anchored popover with a trivial amount of code.

Or that we can pop a ::scroll-button on a scrolling container and get a literal clickable button that scrolls the area? What?? Check out my quantity query carousel for an example there.

It’s just not that hard anymore to get click-something-do-something action out of HTML and CSS alone. Here are a few more examples I’ve collected recently.

Scroll to top