I created a box that fades into another div when hovered over. This was all done using CSS3. However, one problem I realized was that the hovers don\'t work in mobile browse
Hovers aren't possible on mobile devices as there is no persistent cursor - memory of the last touched point by default.
The only way they can sense interaction is touch, which is akin to a click or selection, so :active
in CSS or onclick
in Javascript are your only options currently.
Simplistically, in CSS you can define it:
a.class:active {
background-color: #AAA;
...
}
Or:
.class:active {
background-color: #AAA;
...
}
But you need to use the following workaround (or JS events: ontouchstart) to mimic the click:
<body ontouchstart="">