0

We need to implement hover only for desktop but not to any other devices like (mobile and ipad).

@media (hover: hover), @media (hover: none) and (pointer: coarse)

We have tried restricting using these media queries:

@media (hover: hover) and (pointer: coarse) {
        .abc:hover {
            i {
                background-color: red;
            }

    }
}

I expect the output of Hover should not be observed in any of devices other than in desktop (mainly during swipe/ long press), but the actual output is it is breaking in few android devices like Samsung J8(Chrome version -77.0.3865.92, Android version-9).

help-info.de
  • 6,695
  • 16
  • 39
  • 41

1 Answers1

0

What you can do is, this way the hover only works on screens atleast 1024px wide.

@media screen and (min-width: 1024px) {
  // only put your hover in here
  .abc:hover {
    i { 
      background-color: red
    }
  }
}