I am developing a CSS framework that relies on being simple, minimal and pure CSS as much as possible. What I want is to to make certain things like dropdowns open on hover, however I am uncertain how to go about implementing this with only CSS on mobile devices.
Having checked this answer previously, I confirmed what I partially knew to be true: that certain mobile browsers and devices will use the :hover
pseudo-class when clicking an element, which will allow me to open dropdowns the way I want. Others say that :active
works as well.
I am using both in one rule, as well as :focus
to cover as many environments and cases as possible, however I am not certain this will work well across many devices. So my questions are:
- Is there any way to make sure a hover-based dropdown component will work across devices?
- Are there pseudo-classes or properties that I can use that might be browser-specific or something similar to make sure that most devices are covered?
- Is there documentation about touchscreen, mobile device or mobile browser behaviour and how they handle hover events?