I make a container and I want to change its background color after the user clicks that container but the problem is, it is a div, and the focus state is not working on the div but the active state is working,
<div className="flex space-x-3 items-center hover:bg-messenger-gray-100 focus:bg blue-50 relative p-2 rounded-lg group cursor-pointer border active:bg-blue-50">
{/* the code above on the top level div is not working*/}
{/* Focus is not working on this div */}
{/* active state works */}
<span className=" font-normal whitespace-nowrap ">Muhammad Hamza</span>
</div>
- how can I make the div focusable?
- Is this focus property also don't work on
<span></span>
?