bhylu.com

Advertisements

HTML First CSS

CSS can express presentation without a script that watches every interaction. Focus styles should remain visible for keyboard users.

Where to run this

This example changes a document. Open it in the HTML playground, then select Run code. It runs inside a separate preview.

A practical example

HTML + JavaScript

<style>button { padding: 12px 18px; } button:focus-visible { outline: 3px solid #17634c; outline-offset: 4px; }</style>
<button type="button">Check keyboard focus</button>

What happens

Tab to the button to see a clear focus ring.