【问题标题】:Button and Anchor tag hover & Active not working on Chrome in Iphone按钮和锚标记悬停和活动在 Iphone 中的 Chrome 上不起作用
【发布时间】:2019-04-16 14:10:08
【问题描述】:

桌面:当您将鼠标悬停在按钮或锚链接上时,背景颜色会发生变化。 移动:悬停或活动不会改变背景颜色。

.btn {
 background: transparent;
 color: #000;
}
.btn:hover,
.btn:active {
 background: #bf0;
 color: #fff;
}

【问题讨论】:

  • 请上传html代码
  • 大家好,感谢您的快速回复,我的代码只是一个普通的 html 点击我! 它适用于 Safari 和 Android 设备。但不是在 IOS Chrome 上
  • 在手机中你不能悬停通过点击改变背景颜色的东西
  • 是的,我的意思是即使你点击按钮,它也不会改变

标签: ios css google-chrome mobile


【解决方案1】:

这段代码解决了我的问题

 document.addEventListener("touchstart", function(){}, true)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-11-21
    • 2015-04-04
    • 2013-02-18
    • 1970-01-01
    • 1970-01-01
    • 2014-02-11
    • 1970-01-01
    • 2022-09-23
    相关资源
    最近更新 更多