https://sebastiandedeyne.com/a-css-selector-to-highlight-clickable-elements/ https://sebastiandedeyne.com/tags/css/I was building wireframes for a website with HTML & CSS. When a visitor reviewing the prototype tries to click something that isn’t hooked up, I wanted to clarify what they could interact with.

In the past, I’ve used JavaScript to add an outline to clickable elements when someting non-interactive was clicked.

html:active:not(:has(a:active, button:active, label:active)) :is(a, button, label) { outline: 2px solid blue; } How it works: html:active will match whenever you hold down your mouse on the page :not(:has(a:active, button:active, label:active)) will not match when you’re holding down your mouse on an a, button, or label element, to avoid the outline from appearing when the user clicks something that is functional :is(a, button, label) matches all a, button, and label elements on the page
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners