首页 > 解决方案 > 按钮和锚标签悬停和活动在 Iphone 的 Chrome 上不起作用

问题描述

桌面:当您将鼠标悬停在 Button 或 Anchor Link 上时,背景颜色会发生变化。移动:悬停或活动不会改变背景颜色。

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

标签: ioscssgoogle-chromemobile

解决方案


这段代码解决了我的问题

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

推荐阅读