ios - 按钮和锚标签悬停和活动在 Iphone 的 Chrome 上不起作用
问题描述
桌面:当您将鼠标悬停在 Button 或 Anchor Link 上时,背景颜色会发生变化。移动:悬停或活动不会改变背景颜色。
.btn {
background: transparent;
color: #000;
}
.btn:hover,
.btn:active {
background: #bf0;
color: #fff;
}
解决方案
这段代码解决了我的问题
document.addEventListener("touchstart", function(){}, true)
推荐阅读
- android - Android模拟器在ubuntu中没有声音
- laravel - 如何使用相关模型操作 Laravel 集合并返回自定义实例?
- swift - 如何构造 5x5 矩阵以在 Swift 中应用为颜色矩阵?
- java - 如何解决在四个随机生成的数字中找到最小数字时偶尔出现的错误答案
- python - 最适合这个问题的机器学习算法?
- c# - Xamarin.Forms 中的死锁
- java - Java/Spring JDBC:批量插入 2 个表:从第 1 批插入获取第 2 个表所需的 FK ID
- javascript - 在回调中键入事件的正确方法
- azure - 无法连接到在 Azure 应用服务上运行的 KAFKA
- google-apps-script - HTML 服务不会在 V8 运行时打开侧边栏