1

I'm trying to have a <div> that when you touch it, it slowly changes its background color.

I'm using the :active pseudo class for that:

div {
    background: #fff;
    transition: all .3s linear;
    -o-transition: all .7s linear;
    -moz-transition: all .7s linear;
    -webkit-transition: all .7s linear; 
}

div:active {
    background: #E5CC00;
}

Works perfectly on Chrome, but doesn't work on PhoneGap/Android. I've also tried :hover.

Any ideas?

Alon Gubkin
  • 56,458
  • 54
  • 195
  • 288

1 Answers1

3

The :active pseudo class doesn't work on the div tag on Android. It does work on the anchor tag though. Check out this StackOverflow answer:

How to simulate :active css pseudo class in android on non-link elements?

Community
  • 1
  • 1
Simon MacDonald
  • 23,253
  • 5
  • 58
  • 74