:touch CSS pseudo-class or something similar?

后端 未结 3 1422
终归单人心
终归单人心 2020-11-28 04:14

I am trying to make a button, such that when the user clicks on it, it changes its style while the mouse button is being held down. I also want it to change its style in a s

3条回答
  •  长情又很酷
    2020-11-28 04:39

    Since mobile doesn't give hover feedback, I want, as a user, to see instant feedback when a link is tapped. I noticed that -webkit-tap-highlight-color is the fastest to respond (subjective).

    Add the following to your body and your links will have a tap effect.

    body {
        -webkit-tap-highlight-color: #ccc;
    }
    

提交回复
热议问题