How do I simulate a hover with a touch in touch enabled browsers?

后端 未结 14 2099
旧巷少年郎
旧巷少年郎 2020-11-22 17:04

With some HTML like this:

Some Text

Then some CSS like this:

p {
  color:black;
}

p:hover {
  color:red         


        
14条回答
  •  青春惊慌失措
    2020-11-22 17:23

    One way to do it would be to do the hover effect when the touch starts, then remove the hover effect when the touch moves or ends.

    This is what Apple has to say about touch handling in general, since you mention iPhone.

提交回复
热议问题