A custom control, made of
<div tabIndex="0">....</div>
, raises the question: how can we ensure that it works with :focus-visible
? Sometimes, creating a complex custom control using <div>
and <span>
, styled to resemble a native control, is more straightforward. How do we make a <div>
act like a button for :focus-visible
? And how can we achieve the same effect for a <textarea>
-like <div>
? Is there a way to inform CSS that a specified <div class="my-custom-ctrl">
serves as either a button or a text editor?